vendor/gesdinet/jwt-refresh-token-bundle/Security/Http/Authenticator/Token/PostRefreshTokenAuthenticationToken.php line 18

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the GesdinetJWTRefreshTokenBundle package.
  4.  *
  5.  * (c) Gesdinet <http://www.gesdinet.com/>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Gesdinet\JWTRefreshTokenBundle\Security\Http\Authenticator\Token;
  11. use Gesdinet\JWTRefreshTokenBundle\Model\RefreshTokenInterface;
  12. use Symfony\Component\Security\Core\User\UserInterface;
  13. use Symfony\Component\Security\Http\Authenticator\Token\PostAuthenticationToken;
  14. class PostRefreshTokenAuthenticationToken extends PostAuthenticationToken
  15. {
  16.     private RefreshTokenInterface $refreshToken;
  17.     /**
  18.      * @param string[] $roles An array of roles
  19.      */
  20.     public function __construct(
  21.         UserInterface $user,
  22.         string $firewallName,
  23.         array $roles,
  24.         RefreshTokenInterface $refreshToken
  25.     ) {
  26.         parent::__construct($user$firewallName$roles);
  27.         $this->refreshToken $refreshToken;
  28.     }
  29.     public function getRefreshToken(): RefreshTokenInterface
  30.     {
  31.         return $this->refreshToken;
  32.     }
  33.     /**
  34.      * {@inheritdoc}
  35.      */
  36.     public function __serialize(): array
  37.     {
  38.         return [$this->refreshTokenparent::__serialize()];
  39.     }
  40.     /**
  41.      * {@inheritdoc}
  42.      */
  43.     public function __unserialize(array $data): void
  44.     {
  45.         [$this->refreshToken$parentData] = $data;
  46.         parent::__unserialize($parentData);
  47.     }
  48. }