Symfony2.4 SonataAdminBundle Logout error: You must activate the logout in your security firewall configuration

StackOverflow https://stackoverflow.com/questions/21957044

문제

Login works fine. Getting error at /admin/logout

You must activate the logout in your security firewall configuration.

at

in *\vendor\sonata-project\user-bundle\Controller\AdminSecurityController.php at line 98

I'm setting logout to true as documented:

security.yml:

firewalls:
        main:
            pattern:      .*
            #pattern: ^/
            form-login:
                provider:       fos_userbundle
                csrf_provider:  form.csrf_provider
                login_path:     /login
                use_forward:    false
                check_path:     /login_check
                failure_path:   null
            logout:       true
            anonymous:    true

How do you avoid this error using symfony2.4, fosuserbundle1.3 and sonata-admin dev-master ?

도움이 되었습니까?

해결책

The logout node in your security.yml should contain two subnodes defining the logout path and the target where a user gets redirected after a logout:

logout:
    path:   /admin/logout
    target: /

Not sure if this also works in sonata context, but it should work under normal conditions.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top