Change the post login target on FOSuserBundle Symfony2
When I log in /login
, I'm sent to the root url /
, however I'd like to send users straight to another page /dashboard
- is this a configurable option?
I'm using FOSUserBundle and S开发者_JAVA百科ymfony2.
It seems that login is handled by SecurityBundle, not by FOSUserBundle. The solution is to put the login target here:
#app/config/security.yml
security:
firewalls:
somename:
form_login:
default_target_path: /your-desired-path
Symfony2 documentation here http://symfony.com/doc/current/reference/configuration/security.html#form-login-configuration
精彩评论