Skip to content

Commit

Permalink
Merge pull request #22 from ezprit/fix-token-serialization
Browse files Browse the repository at this point in the history
fix AutoLoginToken serialization
  • Loading branch information
jmikola committed Feb 17, 2021
2 parents 486a6b8 + 3a0e9c6 commit 42686a1
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/Jmikola/AutoLogin/Authentication/Token/AutoLoginToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,14 @@ public function getCredentials() : string
return '';
}

/**
* @see Symfony\Component\Security\Core\Authentication\Token\AbstractToken::serialize()
*/
public function serialize()
public function __serialize(): array
{
return serialize(array(
$this->key,
$this->providerKey,
parent::serialize(),
));
return [$this->key, $this->providerKey, parent::__serialize()];
}

/**
* @see Symfony\Component\Security\Core\Authentication\Token\AbstractToken::unserialize()
*/
public function unserialize($str)
public function __unserialize(array $data): void
{
[$this->key, $this->providerKey, $parentStr] = unserialize($str);
parent::unserialize($parentStr);
[$this->key, $this->providerKey, $parentData] = $data;
parent::__unserialize($parentData);
}
}

0 comments on commit 42686a1

Please sign in to comment.