src/Controller/SecurityController.php line 15
<?phpnamespace App\Controller;use Exception;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Routing\Annotation\Route;use Symfony\Component\Security\Core\Exception\AccessDeniedException;use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;class SecurityController extends AbstractController{#[Route('/login', name: 'login')]public function login(AuthenticationUtils $authenticationUtils): Response{$error = $authenticationUtils->getLastAuthenticationError();$lastUsername = $authenticationUtils->getLastUsername();if ($this->getUser()) {return $this->redirect($this->generateUrl('app_gestion_dashboard_index'));}return $this->render('user/login.html.twig', ['controller_name' => 'UserController','last_username' => $lastUsername,'error' => $error,]);}/*** @throws Exception*/#[Route('/logout', name: 'logout')]public function logout(): void{throw new AccessDeniedException('Bye');}}