소스 검색

[Security] Improving the exception when the security context has no token

This either mostly - or always - means that no firewall is currently activated. This message tries to alert the user to this.

Reword
Ryan Weaver 14 년 전
부모
커밋
1de34fde98
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Symfony/Component/Security/Core/SecurityContext.php

+ 1 - 1
src/Symfony/Component/Security/Core/SecurityContext.php

@@ -58,7 +58,7 @@ class SecurityContext implements SecurityContextInterface
     public final function isGranted($attributes, $object = null)
     {
         if (null === $this->token) {
-            throw new AuthenticationCredentialsNotFoundException('The security context contains no authentication token.');
+            throw new AuthenticationCredentialsNotFoundException('The security context contains no authentication token. One possible reason may be that there is no firewall configured for this URL.');
         }
 
         if ($this->alwaysAuthenticate || !$this->token->isAuthenticated()) {