diff options
Diffstat (limited to 'Authentication/Token/RememberMeToken.php')
-rw-r--r-- | Authentication/Token/RememberMeToken.php | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/Authentication/Token/RememberMeToken.php b/Authentication/Token/RememberMeToken.php index 50284aa..f006a3a 100644 --- a/Authentication/Token/RememberMeToken.php +++ b/Authentication/Token/RememberMeToken.php @@ -22,6 +22,7 @@ use Symfony\Component\Security\User\AccountInterface; class RememberMeToken extends Token { protected $key; + protected $providerKey; /** * The persistent token which resulted in this authentication token. @@ -36,30 +37,39 @@ class RememberMeToken extends Token * @param string $username * @param string $key */ - public function __construct(AccountInterface $user, $key) { + public function __construct(AccountInterface $user, $providerKey, $key) { parent::__construct($user->getRoles()); - if (0 === strlen($key)) { - throw new \InvalidArgumentException('$key cannot be empty.'); + if (empty($key)) { + throw new \InvalidArgumentException('$key must not be empty.'); + } + if (empty($providerKey)) { + throw new \InvalidArgumentException('$providerKey must not be empty.'); } - $this->user = $user; + $this->setUser($user); + $this->providerKey = $providerKey; $this->key = $key; $this->setAuthenticated(true); } - public function getKey() + public function getProviderKey() { - return $this->key; + return $this->providerKey; } - public function setPersistentToken(PersistentTokenInterface $persistentToken) + public function getKey() { - $this->persistentToken = $persistentToken; + return $this->key; } public function getPersistentToken() { return $this->persistentToken; } -} + + public function setPersistentToken(PersistentTokenInterface $persistentToken) + { + $this->persistentToken = $persistentToken; + } +}
\ No newline at end of file |