Skip to content

Commit 5e879c1

Browse files
committed
Merge branch '5.4' into 6.2
* 5.4: [Security] Use POST method for logout route
2 parents d01a2bb + bca776a commit 5e879c1

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
@@ -1741,7 +1741,7 @@ Next, you need to create a route for this URL (but not a controller):
17411741
17421742
class SecurityController extends AbstractController
17431743
{
1744-
#[Route('/logout', name: 'app_logout', methods: ['GET'])]
1744+
#[Route('/logout', name: 'app_logout', methods: ['POST'])]
17451745
public function logout()
17461746
{
17471747
// controller can be blank: it will never be called!
@@ -1754,7 +1754,7 @@ Next, you need to create a route for this URL (but not a controller):
17541754
# config/routes.yaml
17551755
app_logout:
17561756
path: /logout
1757-
methods: GET
1757+
methods: POST
17581758
17591759
.. code-block:: xml
17601760
@@ -1765,7 +1765,7 @@ Next, you need to create a route for this URL (but not a controller):
17651765
xsi:schemaLocation="http://symfony.com/schema/routing
17661766
https://symfony.com/schema/routing/routing-1.0.xsd">
17671767
1768-
<route id="app_logout" path="/logout" methods="GET"/>
1768+
<route id="app_logout" path="/logout" methods="POST"/>
17691769
</routes>
17701770
17711771
.. code-block:: php
@@ -1775,7 +1775,7 @@ Next, you need to create a route for this URL (but not a controller):
17751775
17761776
return function (RoutingConfigurator $routes) {
17771777
$routes->add('app_logout', '/logout')
1778-
->methods(['GET'])
1778+
->methods(['POST'])
17791779
;
17801780
};
17811781

0 commit comments

Comments
 (0)