DeauthenticatedEvent.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.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 Symfony\Component\Security\Http\Event;
  11. use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
  12. use Symfony\Contracts\EventDispatcher\Event;
  13. /**
  14. * Deauthentication happens in case the user has changed when trying to refresh the token.
  15. *
  16. * @author Hamza Amrouche <hamza.simperfit@gmail.com>
  17. */
  18. final class DeauthenticatedEvent extends Event
  19. {
  20. private $originalToken;
  21. private $refreshedToken;
  22. public function __construct(TokenInterface $originalToken, TokenInterface $refreshedToken)
  23. {
  24. $this->originalToken = $originalToken;
  25. $this->refreshedToken = $refreshedToken;
  26. }
  27. public function getRefreshedToken(): TokenInterface
  28. {
  29. return $this->refreshedToken;
  30. }
  31. public function getOriginalToken(): TokenInterface
  32. {
  33. return $this->originalToken;
  34. }
  35. }