diff options
Diffstat (limited to 'Authentication/Token')
-rw-r--r-- | Authentication/Token/PreAuthenticatedToken.php | 2 | ||||
-rw-r--r-- | Authentication/Token/Token.php | 4 | ||||
-rw-r--r-- | Authentication/Token/TokenInterface.php | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/Authentication/Token/PreAuthenticatedToken.php b/Authentication/Token/PreAuthenticatedToken.php index 7466757..9532c53 100644 --- a/Authentication/Token/PreAuthenticatedToken.php +++ b/Authentication/Token/PreAuthenticatedToken.php @@ -23,8 +23,8 @@ class PreAuthenticatedToken extends Token */ public function __construct($user, $credentials, array $roles = null) { + parent::__construct(null === $roles ? array() : $roles); if (null !== $roles) { - parent::__construct($roles); $this->setAuthenticated(true); } diff --git a/Authentication/Token/Token.php b/Authentication/Token/Token.php index 1903cc1..46a97e2 100644 --- a/Authentication/Token/Token.php +++ b/Authentication/Token/Token.php @@ -42,6 +42,8 @@ abstract class Token implements TokenInterface } $this->addRole($role); } + $this->authenticated = false; + $this->immutable = false; } /** @@ -107,7 +109,7 @@ abstract class Token implements TokenInterface } /** - * Removes sensitive information from the token. + * {@inheritdoc} */ public function eraseCredentials() { diff --git a/Authentication/Token/TokenInterface.php b/Authentication/Token/TokenInterface.php index 9dcc820..01753cf 100644 --- a/Authentication/Token/TokenInterface.php +++ b/Authentication/Token/TokenInterface.php @@ -66,4 +66,9 @@ interface TokenInterface extends \Serializable * @param Boolean $isAuthenticated The authenticated flag */ function setAuthenticated($isAuthenticated); + + /** + * Removes sensitive information from the token. + */ + function eraseCredentials(); } |