File tree Expand file tree Collapse file tree 1 file changed +19
-12
lines changed Expand file tree Collapse file tree 1 file changed +19
-12
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments