Skip to content

Instantly share code, notes, and snippets.

View ThomasLandauer's full-sized avatar

Thomas Landauer ThomasLandauer

View GitHub Profile
@ThomasLandauer
ThomasLandauer / SecurityController.php
Last active August 19, 2022 14:19
Magic Link login with Symfony to secure just one route
<?php
// src/Controller/SecurityController.php
namespace App\Controller;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Guard\GuardAuthenticatorHandler;