Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ Next, you need to create a route for this URL (but not a controller):
class SecurityController extends AbstractController
{
/**
* @Route("/logout", name="app_logout", methods={"GET"})
* @Route("/logout", name="app_logout", methods={"POST"})
*/
public function logout(): void
{
Expand All @@ -1705,7 +1705,7 @@ Next, you need to create a route for this URL (but not a controller):

class SecurityController extends AbstractController
{
#[Route('/logout', name: 'app_logout', methods: ['GET'])]
#[Route('/logout', name: 'app_logout', methods: ['POST'])]
public function logout()
{
// controller can be blank: it will never be called!
Expand All @@ -1718,7 +1718,7 @@ Next, you need to create a route for this URL (but not a controller):
# config/routes.yaml
app_logout:
path: /logout
methods: GET
methods: POST

.. code-block:: xml

Expand All @@ -1729,7 +1729,7 @@ Next, you need to create a route for this URL (but not a controller):
xsi:schemaLocation="http://symfony.com/schema/routing
https://symfony.com/schema/routing/routing-1.0.xsd">

<route id="app_logout" path="/logout" methods="GET"/>
<route id="app_logout" path="/logout" methods="POST"/>
</routes>

.. code-block:: php
Expand All @@ -1739,7 +1739,7 @@ Next, you need to create a route for this URL (but not a controller):

return function (RoutingConfigurator $routes) {
$routes->add('app_logout', '/logout')
->methods(['GET'])
->methods(['POST'])
;
};

Expand Down