<?phpnamespace App\Controller\Admin;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;/** * ══════════════════════════════════════════════════════════════════════════ * CONNEXION AU NOUVEAU BACKOFFICE — /admin/login * * Le formulaire seulement. Le POST est traité par * `Security/LoginFormAuthenticator`, qui connaît la route `admin_login` * (même mécanisme que `backend_login`, l'ancien écran). * * Les champs `email`, `password`, `_csrf_token` (jeton `authenticate`) * sont imposés par l'authentificateur. * ══════════════════════════════════════════════════════════════════════════ */class SecurityController extends AbstractController{ public function login(AuthenticationUtils $auth): Response { if ($this->isGranted('ROLE_ADMIN')) { return $this->redirectToRoute('admin_dashboard'); } return $this->render('admin/login.html.twig', [ 'derniereErreur' => $auth->getLastAuthenticationError(), 'dernierEmail' => $auth->getLastUsername(), ]); }}