FOSUserBundle redirect from login page after logged in

前端 未结 4 826
北恋
北恋 2020-12-02 15:05

I simply want that if admin user or front end user try to access login page even after logged in

/admin/login (admin user) 

OR



        
4条回答
  •  余生分开走
    2020-12-02 15:32

    The easier solution is to add these two lines to your app/config/security.yml:

    always_use_default_target_path & default_target_path, e.g.:

    firewalls:
        main:
            pattern: ^/
            form_login:
                provider: fos_userbundle
                csrf_provider: form.csrf_provider
                login_path: /login
                check_path: /login_check
                always_use_default_target_path: false
                default_target_path:            /your/start/path/
    

提交回复
热议问题