src/Controller/LoginController.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  7. class LoginController extends AbstractController
  8. {
  9.     /**
  10.      * @param AuthenticationUtils $authenticationUtils
  11.      *
  12.      * @return Response
  13.      */
  14.     #[Route('/login'name'app_login')]
  15.     public function index(AuthenticationUtils $authenticationUtils): Response
  16.     {
  17.         $error $authenticationUtils->getLastAuthenticationError();
  18.         $lastUsername $authenticationUtils->getLastUsername();
  19.         return $this->render('login/index.html.twig', [
  20.             'last_username' => $lastUsername,
  21.             'error'         => $error,
  22.         ]);
  23.     }
  24. }