Twig_Error_Runtime - 令牌存储不包含身份验证令牌

时间:2015-03-31 10:46:25

标签: symfony twig

在Symfony2 / production上,我在日志文件中出现此错误

request.CRITICAL:
Uncaught PHP Exception Twig_Error_Runtime: 
"An exception has been thrown during the rendering of a template ("The  token storage contains no authentication token.
One possible reason may be that there is no firewall configured for this URL.") in "TwigBundle:Exception:error.html.twig" at line 22."

发布帖后,我的TwigBundle:例外:error.html.twig

{% if app.user is defined and is_granted('IS_AUTHENTICATED_REMEMBERED') %}

这是我的security.yml

security:
    encoders:
        App\Entity\User: sha512

    providers:
        user:
            entity: { class: App:User, property: email }

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt|error)|css|images|js)/
            security: false

        main:
            pattern: ^/
            anonymous: true
            provider: user
            form_login:
                login_path: /
                check_path: /securite/connexion/check
                use_referer: true
            logout:
                path: app_security_logout
                target: app_homepage

有什么想法吗?感谢

0 个答案:

没有答案