src/Controller/LoginController.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\HttpFoundation\Request;
  7. class LoginController extends AbstractController
  8. {
  9.     public function index(AuthenticationUtils $authenticationUtils): Response {
  10.         // get the login error if there is one
  11.         $error $authenticationUtils->getLastAuthenticationError();
  12.         // last username entered by the user
  13.         $lastUsername $authenticationUtils->getLastUsername();
  14.         return $this->render('security/login/index.html.twig', [
  15.                     'last_username' => $lastUsername,
  16.                     'error' => $error,
  17.         ]);
  18.     }
  19. }