src/Application/Controller/App/SecurityController.php line 17

Open in your IDE?
  1. <?php
  2. namespace BackendApi\Application\Controller\App;
  3. use LogicException;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  8. class SecurityController extends AbstractController
  9. {
  10.     /**
  11.      * @Route("/login", name="app_login")
  12.      */
  13.     public function login(AuthenticationUtils $authenticationUtils): Response
  14.     {
  15.         $error $authenticationUtils->getLastAuthenticationError();
  16.         $lastUsername $authenticationUtils->getLastUsername();
  17.         return $this->render('@EasyAdmin/page/login.html.twig', [
  18.             'last_username' => $lastUsername,
  19.             'error' => $error,
  20.             'csrf_token_intention' => 'authenticate',
  21.             'page_title' => 'Baume',
  22.             'favicon_path' => 'assets/images/favicon.png',
  23.         ]);
  24.     }
  25.     /**
  26.      * @Route("/logout", name="app_logout")
  27.      */
  28.     public function logout(): void
  29.     {
  30.         throw new LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
  31.     }
  32. }