* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Http\LoginLink; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Security\Core\User\UserInterface; /** * A class that is able to create and handle "magic" login links. * * @author Ryan Weaver * @experimental in 5.2 */ interface LoginLinkHandlerInterface { /** * Generate a link that can be used to authenticate as the given user. */ public function createLoginLink(UserInterface $user): LoginLinkDetails; /** * Validates if this request contains a login link and returns the associated User. * * Throw InvalidLoginLinkExceptionInterface if the link is invalid. */ public function consumeLoginLink(Request $request): UserInterface; }