-2

I'm working on a project which uses FOSUser Bundle to manage my users but I'm encountering an issue.

In fact, an authenticated user still can access /login or / register routes.

Even though, my access_control looks like this:

access_control:
    - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/admin, role: ROLE_ADMIN }

What's wrong with that and how can I correct it ?

Anthon
  • 69,918
  • 32
  • 186
  • 246
Maxime
  • 31
  • 1
  • 8

1 Answers1

0

There's no restriction in place that would prevent authenticated users from accessing the login and register routes, so naturally they're able to access the said routes.

If however you wish to redirect already logged in users to another route please check this answer: FOSUserBundle - How to redirect already logged-in users when trying to access the login_path

Community
  • 1
  • 1
Assil
  • 343
  • 2
  • 10