From 22fd47e952bb51ac30008127a7f59bc361a438c8 Mon Sep 17 00:00:00 2001 From: maxhelias Date: Mon, 10 Aug 2020 11:08:49 +0200 Subject: [PATCH] Fix logout on form login setup --- security/form_login_setup.rst | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/security/form_login_setup.rst b/security/form_login_setup.rst index 7e82ef333a4..1f48401571f 100644 --- a/security/form_login_setup.rst +++ b/security/form_login_setup.rst @@ -99,12 +99,13 @@ Edit the ``security.yaml`` file in order to declare the ``/logout`` path: security: # ... - providers: - # ... - logout: - path: app_logout - # where to redirect after logout - # target: app_any_route + firewalls: + main: + # ... + logout: + path: app_logout + # where to redirect after logout + # target: app_any_route .. code-block:: xml @@ -117,8 +118,11 @@ Edit the ``security.yaml`` file in order to declare the ``/logout`` path: https://symfony.com/schema/dic/services/services-1.0.xsd"> - + + + + @@ -127,12 +131,15 @@ Edit the ``security.yaml`` file in order to declare the ``/logout`` path: // config/packages/security.php $container->loadFromExtension('security', [ // ... - 'access_control' => [ - [ - 'path' => '^/login', - 'roles' => 'IS_AUTHENTICATED_ANONYMOUSLY', + 'firewalls' => [ + 'main' => [ + // ... + 'logout' => [ + 'path' => 'app_logout', + // where to redirect after logout + 'target' => 'app_any_route' + ], ], - // ... ], ]);