src/Controller/SecurityController.php line 13

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.     #[Route('/login'name'app_login')]
  10.     public function login(AuthenticationUtils $authenticationUtils): Response
  11.     {
  12.         return $this->render('security/login.html.twig', [
  13.             'error' => $authenticationUtils->getLastAuthenticationError(),
  14.             'last_username' => $authenticationUtils->getLastUsername(),
  15.         ]);
  16.     }
  17.     #[Route('/logout'name'app_logout')]
  18.     public function logout()
  19.     {
  20.         throw new \Exception('logout() should never be called');
  21.     }
  22. }