Wednesday, May 29, 2013

Symfony 2.1 - Error Template - The security context contains no authentication token.

For Symfony 2.1, your twig error templates cannot use is_granted in your templates. If you do, an error will be thrown. Because Symfony handles 404 errors differently in production and dev, you will probably see this error after you push your code to production.

You have two choices:

  1. get rid of all the is_granted or similar functions
  2. do a check for "app.user is not null"

No comments:

Post a Comment