Symfony2 is_granted('IS_AUTHENTICATED_FULLY') during 404 error page display, causing ResourceNotFoundException

前端 未结 3 1918
天命终不由人
天命终不由人 2020-12-29 07:09

I have setup custom error pages to display for certain HTTP errors in the folder:

app/Resources/TwigBundle/views/Exception/

The 403 page (<

3条回答
  •  时光取名叫无心
    2020-12-29 07:30

    You can't use the is_granted in a 404 page since 2.1:

    It's mentioned in the upgrade file

    The Firewall listener is now registered after the Router listener. This means that specific Firewall URLs (like /login_check and /logout) must now have proper routes defined in your routing configuration. Also, if you have a custom 404 error page, make sure that you do not use any security related features such as is_granted on it.

    See: https://github.com/symfony/symfony/blob/master/UPGRADE-2.1.md#security

提交回复
热议问题