Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Symfony2 and FOSUserBundle, override the login_check

In the moment that the user is authenticated, I need to check his role to redirect him to the correct page (two different pages for two different roles).

I haven't found in the documentation how to override the login_check. Right from the bundle, it uses the security.yml configuration proxy to tell the engine to go to one unique default page. Any clue?

The same problem for logout.

like image 986
ElPiter Avatar asked Feb 20 '23 13:02

ElPiter


1 Answers

If I understood you correctly, you want to redirect freshly logged in/logged out user to appropriate route depending on its role?

Here is a tutorial on how to do redirection on login/logout using form handlers.

like image 117
Marko Jovanović Avatar answered Mar 05 '23 18:03

Marko Jovanović