src/Admin/UI/Web/Controller/Security/SecurityController.php line 13

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Admin\UI\Web\Controller\Security;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  7. class SecurityController extends AbstractController
  8. {
  9.     public function login(AuthenticationUtils $authenticationUtils): Response
  10.     {
  11.         $error $authenticationUtils->getLastAuthenticationError();
  12.         if ($error !== null) {
  13.             $this->addFlash('danger''ui.login.error');
  14.         }
  15.         return $this->render('Admin/security/login.html.twig', [
  16.             'error' => $error,
  17.             'username' => $authenticationUtils->getLastUsername(),
  18.         ]);
  19.     }
  20. }