File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ You need to configure a route for the context hash. It does not specify any
49
49
controller, as the request listener will abort the request right after the
50
50
firewall has been applied, but the route definition must exist. Use the same
51
51
path as you specified in the caching proxy and make sure that this path is
52
- covered by your
52
+ allowed for anonymous users and covered by your
53
53
`firewall configuration <http://symfony.com/doc/current/book/security.html >`_:
54
54
55
55
.. code-block :: yaml
@@ -58,6 +58,17 @@ covered by your
58
58
user_context_hash :
59
59
path : /_fos_user_context_hash
60
60
61
+ If your access rules limit the whole site to logged in users, make sure to
62
+ handle the user context URL like the login page:
63
+
64
+ .. code-block :: yaml
65
+
66
+ # app/config/security.yml
67
+ access_control :
68
+ - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
69
+ - { path: ^/_fos_user_context_hash, roles: [IS_AUTHENTICATED_ANONYMOUSLY] }
70
+ - { path: ^/, roles: ROLE_USER }
71
+
61
72
Finally, enable the subscriber with the default settings:
62
73
63
74
.. code-block :: yaml
Original file line number Diff line number Diff line change 14
14
lookups
15
15
TTL
16
16
multi
17
+ login
17
18
logout
You can’t perform that action at this time.
0 commit comments