简体   繁体   English

在FOSuserBundle Symfony2上更改发布登录目标

[英]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? 当我登录/login ,我被发送到根url / ,但是我想直接将用户发送到另一个页面/dashboard这是可配置的选项吗?

I'm using FOSUserBundle and Symfony2. 我正在使用FOSUserBundle和Symfony2。

It seems that login is handled by SecurityBundle, not by FOSUserBundle. 似乎登录是由SecurityBundle处理的,而不是由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 Symfony2文档在这里http://symfony.com/doc/current/reference/configuration/security.html#form-login-configuration

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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