src/Controller/LoginController.php line 13
<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class LoginController extends AbstractController
{
#[Route("/")]
#[Route("/admin/login", name: "app_admin_login")]
public function indexAdmin(AuthenticationUtils $authenticationUtils): Response
{
$errors = $authenticationUtils->getLastAuthenticationError();
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render("login/index_admin.html.twig",
[
"last_username" => $lastUsername,
"error" => $errors
]);
}
#[Route("/logout", name: "app_logout")]
public function logout()
{
throw new \LogicException();
}
#[Route("/admin/logout", name: "app_admin_logout")]
public function adminLogout(): Response
{
return $this->render('logout/index_admin.html.twig');
}
}