Skip to content

Commit 72e1f87

Browse files
committed
minor #14047 [Security] Fix logout on form login setup (maxhelias)
This PR was merged into the 4.4 branch. Discussion ---------- [Security] Fix logout on form login setup Introduced with #13864 Commits ------- 22fd47e Fix logout on form login setup
2 parents 4d52670 + 22fd47e commit 72e1f87

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

security/form_login_setup.rst

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,13 @@ Edit the ``security.yaml`` file in order to declare the ``/logout`` path:
9999
security:
100100
# ...
101101
102-
providers:
103-
# ...
104-
logout:
105-
path: app_logout
106-
# where to redirect after logout
107-
# target: app_any_route
102+
firewalls:
103+
main:
104+
# ...
105+
logout:
106+
path: app_logout
107+
# where to redirect after logout
108+
# target: app_any_route
108109
109110
.. code-block:: xml
110111
@@ -117,8 +118,11 @@ Edit the ``security.yaml`` file in order to declare the ``/logout`` path:
117118
https://symfony.com/schema/dic/services/services-1.0.xsd">
118119
119120
<config>
120-
<rule path="^/login$" role="IS_AUTHENTICATED_ANONYMOUSLY"/>
121121
<!-- ... -->
122+
<firewall name="main">
123+
<!-- ... -->
124+
<logout path="app_logout"/>
125+
</firewall>
122126
</config>
123127
</srv:container>
124128
@@ -127,12 +131,15 @@ Edit the ``security.yaml`` file in order to declare the ``/logout`` path:
127131
// config/packages/security.php
128132
$container->loadFromExtension('security', [
129133
// ...
130-
'access_control' => [
131-
[
132-
'path' => '^/login',
133-
'roles' => 'IS_AUTHENTICATED_ANONYMOUSLY',
134+
'firewalls' => [
135+
'main' => [
136+
// ...
137+
'logout' => [
138+
'path' => 'app_logout',
139+
// where to redirect after logout
140+
'target' => 'app_any_route'
141+
],
134142
],
135-
// ...
136143
],
137144
]);
138145

0 commit comments

Comments
 (0)