Skip to content

Commit 91209c3

Browse files
committed
Merge branch '6.2' into 6.3
* 6.2: [Security] Use POST method for logout route
2 parents 9e27d67 + 5e879c1 commit 91209c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

security.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,7 @@ Next, you need to create a route for this URL (but not a controller):
17761776
17771777
class SecurityController extends AbstractController
17781778
{
1779-
#[Route('/logout', name: 'app_logout', methods: ['GET'])]
1779+
#[Route('/logout', name: 'app_logout', methods: ['POST'])]
17801780
public function logout()
17811781
{
17821782
// controller can be blank: it will never be called!
@@ -1789,7 +1789,7 @@ Next, you need to create a route for this URL (but not a controller):
17891789
# config/routes.yaml
17901790
app_logout:
17911791
path: /logout
1792-
methods: GET
1792+
methods: POST
17931793
17941794
.. code-block:: xml
17951795
@@ -1800,7 +1800,7 @@ Next, you need to create a route for this URL (but not a controller):
18001800
xsi:schemaLocation="http://symfony.com/schema/routing
18011801
https://symfony.com/schema/routing/routing-1.0.xsd">
18021802
1803-
<route id="app_logout" path="/logout" methods="GET"/>
1803+
<route id="app_logout" path="/logout" methods="POST"/>
18041804
</routes>
18051805
18061806
.. code-block:: php
@@ -1810,7 +1810,7 @@ Next, you need to create a route for this URL (but not a controller):
18101810
18111811
return function (RoutingConfigurator $routes) {
18121812
$routes->add('app_logout', '/logout')
1813-
->methods(['GET'])
1813+
->methods(['POST'])
18141814
;
18151815
};
18161816

0 commit comments

Comments
 (0)