简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM