vendor/symfony/security-http/LoginLink/LoginLinkHandlerInterface.php line 29

  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\LoginLink;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\Security\Core\User\UserInterface;
  13. /**
  14.  * A class that is able to create and handle "magic" login links.
  15.  *
  16.  * @author Ryan Weaver <ryan@symfonycasts.com>
  17.  */
  18. interface LoginLinkHandlerInterface
  19. {
  20.     /**
  21.      * Generate a link that can be used to authenticate as the given user.
  22.      *
  23.      * @param int|null $lifetime When not null, the argument overrides any default lifetime previously set
  24.      */
  25.     public function createLoginLink(UserInterface $userRequest $request null /* , int $lifetime = null */): LoginLinkDetails;
  26.     /**
  27.      * Validates if this request contains a login link and returns the associated User.
  28.      *
  29.      * Throw InvalidLoginLinkExceptionInterface if the link is invalid.
  30.      */
  31.     public function consumeLoginLink(Request $request): UserInterface;
  32. }