redirection good

This commit is contained in:
Olivier PARPAILLON
2024-11-19 14:01:57 +01:00
parent 8ddbf9c5d6
commit 5744d77e70
5 changed files with 32 additions and 11 deletions

View File

@@ -16,6 +16,10 @@ class LoginController extends AbstractController
#[Route(path: '/login', name: 'app_login')]
public function login(AuthenticationUtils $authenticationUtils, Security $security, Request $request): Response
{
if ($security->isGranted('ROLE_USER')) {
return $this->redirectToRoute('home'); // Redirection pour utilisateurs connectés
}
// get the login error if there is one
$error = $authenticationUtils->getLastAuthenticationError();