src/UserInterface/Security/Controller/SecurityController.php line 15
<?php
declare(strict_types=1);
namespace App\UserInterface\Security\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class SecurityController extends AbstractController
{
#[Route('/admin/login', name: 'admin_login')]
public function login(AuthenticationUtils $authenticationUtils): Response
{
if ($this->getUser()) {
return $this->redirectToRoute('admin');
}
$error = $authenticationUtils->getLastAuthenticationError();
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render('@security/login.html.twig', [
'last_username' => $lastUsername,
'error' => $error,
'page_title' => '<h1>'.$this->getParameter('app_name').'</h1>',
'csrf_token_intention' => 'authenticate',
'target_path' => $this->generateUrl('admin'),
'username_label' => 'Email',
]);
}
#[Route('/admin/logout', name: 'admin_logout')]
public function logout(): void
{
}
}