src/Controller/SecurityController.php line 19

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 SecurityController extends AbstractController
  8. {
  9.     /**
  10.      * @Route("/login", name="login", methods={"GET", "POST"})
  11.      *
  12.      * @param AuthenticationUtils $authenticationUtils
  13.      *
  14.      * @return Response
  15.      */
  16.     public function login(AuthenticationUtils $authenticationUtils): Response
  17.     {
  18.         $error $authenticationUtils->getLastAuthenticationError();
  19.         $lastUsername $authenticationUtils->getLastUsername();
  20.         return $this->render('security/login.html.twig', [
  21.             'last_username' => $lastUsername,
  22.             'error'         => $error,
  23.         ]);
  24.     }
  25.     /**
  26.      * @Route("/logout", name="logout")
  27.      */
  28.     public function logout(): void
  29.     {
  30.     }
  31. }