src/Controller/LoginController.php line 13

  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Component\HttpFoundation\Response;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  6. class LoginController extends AbstractController
  7. {
  8.     #[Route("/")]
  9.     #[Route("/admin/login"name"app_admin_login")]
  10.     public function indexAdmin(AuthenticationUtils $authenticationUtils): Response
  11.     {
  12.         $errors $authenticationUtils->getLastAuthenticationError();
  13.         $lastUsername $authenticationUtils->getLastUsername();
  14.         return $this->render("login/index_admin.html.twig",
  15.         [
  16.             "last_username" => $lastUsername,
  17.             "error" => $errors
  18.         ]);
  19.     }
  20.     #[Route("/logout"name"app_logout")]
  21.     public function logout()
  22.     {
  23.         throw new \LogicException();
  24.     }
  25.     #[Route("/admin/logout"name"app_admin_logout")]
  26.     public function adminLogout(): Response
  27.     {
  28.         return $this->render('logout/index_admin.html.twig');
  29.     }
  30. }