草庐IT

php - Symfony.4 Sonata AdminBundle 注销错误 : You must activate the logout in your security firewall configuration

coder 2024-04-09 原文

登录正常。在/admin/logout 出现错误

You must activate the logout in your security firewall configuration.

在 *\vendor\sonata-project\user-bundle\Controller\AdminSecurityController.php 第 98 行

我按照记录将注销设置为 true:

安全.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

如何使用 symfony2.4、fosuserbundle1.3 和 sonata-admin dev-master 避免这个错误?

最佳答案

security.yml 中的 logout 节点应该包含两个子节点,定义注销路径和用户在注销后重定向的目标:

logout:
    path:   /admin/logout
    target: /

不确定这是否也适用于奏鸣曲上下文,但它应该在正常情况下有效。

关于php - Symfony.4 Sonata AdminBundle 注销错误 : You must activate the logout in your security firewall configuration,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21957044/

有关php - Symfony.4 Sonata AdminBundle 注销错误 : You must activate the logout in your security firewall configuration的更多相关文章

随机推荐