Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ?

like image 286
Jalmarez Avatar asked Nov 29 '22 11:11

Jalmarez


1 Answers

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.

like image 60
Pierre Avatar answered Dec 06 '22 09:12

Pierre