File tree 1 file changed +19
-12
lines changed 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:
99
99
security :
100
100
# ...
101
101
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
108
109
109
110
.. code-block :: xml
110
111
@@ -117,8 +118,11 @@ Edit the ``security.yaml`` file in order to declare the ``/logout`` path:
117
118
https://symfony.com/schema/dic/services/services-1.0.xsd" >
118
119
119
120
<config >
120
- <rule path =" ^/login$" role =" IS_AUTHENTICATED_ANONYMOUSLY" />
121
121
<!-- ... -->
122
+ <firewall name =" main" >
123
+ <!-- ... -->
124
+ <logout path =" app_logout" />
125
+ </firewall >
122
126
</config >
123
127
</srv : container >
124
128
@@ -127,12 +131,15 @@ Edit the ``security.yaml`` file in order to declare the ``/logout`` path:
127
131
// config/packages/security.php
128
132
$container->loadFromExtension('security', [
129
133
// ...
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
+ ],
134
142
],
135
- // ...
136
143
],
137
144
]);
138
145
You can’t perform that action at this time.
0 commit comments