src/Controller/SecurityController.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Component\HttpFoundation\Response;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  7. class SecurityController extends AbstractController
  8. {
  9.     /**
  10.      * @Route("/admin/login", name="account_admin_login")
  11.      */
  12.     public function index(AuthenticationUtils $utils): Response
  13.     {
  14.         $error $utils->getLastAuthenticationError();
  15.         $username $utils->getLastUsername();
  16.         return $this->render('security/index.html.twig', ['hasError' => $error !== null'username' => $username]);
  17.     }
  18.     /**
  19.      * @Route("/login_check", name="login_check")
  20.      */
  21.     public function check()
  22.     {
  23.         throw new \LogicException('This code should never be reached');
  24.     }
  25. }