Skip to content

Commit b904ca9

Browse files
committed
Remove mentions of logout controllers being useless
1 parent 162ce75 commit b904ca9

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

security.rst

+1-23
Original file line numberDiff line numberDiff line change
@@ -1890,32 +1890,10 @@ Otherwise, you can enable this behavior yourself by importing the
18901890

18911891
Another option is to configure ``path`` as a route name, which can be useful if
18921892
you want logout URIs to be translated according to the current locale e.g.
1893-
In that case, you have to create this route yourself.
1894-
Note that it doesn't need a controller, because it wouldn't be called anyways:
1893+
In that case, you have to create this route yourself:
18951894

18961895
.. configuration-block::
18971896

1898-
.. code-block:: php-attributes
1899-
1900-
// src/Controller/SecurityController.php
1901-
namespace App\Controller;
1902-
1903-
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1904-
use Symfony\Component\Routing\Annotation\Route;
1905-
1906-
class SecurityController extends AbstractController
1907-
{
1908-
#[Route([
1909-
'en' => '/logout',
1910-
'fr' => '/deconnexion'
1911-
], name: 'app_logout', methods: ['GET'])]
1912-
public function logout(): never
1913-
{
1914-
// controller can be blank: it will never be called!
1915-
throw new \Exception('Don\'t forget to activate logout in security.yaml');
1916-
}
1917-
}
1918-
19191897
.. code-block:: yaml
19201898
19211899
# config/routes.yaml

0 commit comments

Comments
 (0)