开发者

Change the post login target on FOSuserBundle Symfony2

开发者 https://www.devze.com 2023-04-08 18:38 出处:网络
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?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消