From d7b1aa66929cd159a4d15f021cffc36ce399633b Mon Sep 17 00:00:00 2001 From: ragueneaul Date: Fri, 18 Apr 2025 09:47:40 +0200 Subject: [PATCH] chargement propre pour le login --- config/packages/security.yaml | 8 ++++---- src/Controller/AuthenticationController.php | 4 ++-- templates/login/index.html.twig | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/packages/security.yaml b/config/packages/security.yaml index f695019..29999da 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -20,14 +20,14 @@ security: provider: app_user_provider form_login: - login_path: app_login - check_path: app_login + login_path: _login + check_path: _login enable_csrf: true csrf_token_id: authenticate logout: - path: app_logout - target: app_login + path: _logout + target: _login diff --git a/src/Controller/AuthenticationController.php b/src/Controller/AuthenticationController.php index 94fec26..d8e6b43 100644 --- a/src/Controller/AuthenticationController.php +++ b/src/Controller/AuthenticationController.php @@ -9,7 +9,7 @@ use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; class AuthenticationController extends AbstractController { - #[Route(path: '/', name: 'app_login')] + #[Route(path: '/', name: '_login')] public function login(AuthenticationUtils $authenticationUtils): Response { // get the login error if there is one @@ -24,7 +24,7 @@ class AuthenticationController extends AbstractController ]); } - #[Route(path: '/logout', name: 'app_logout')] + #[Route(path: '/logout', name: '_logout')] public function logout(): void { throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.'); diff --git a/templates/login/index.html.twig b/templates/login/index.html.twig index cae5255..a1ee3c7 100644 --- a/templates/login/index.html.twig +++ b/templates/login/index.html.twig @@ -32,7 +32,7 @@ {% if app.user %}
- Vous êtes connecté en tant que {{ app.user.userIdentifier }}, Déconnexion + Vous êtes connecté en tant que {{ app.user.userIdentifier }}, Déconnexion
{% endif %}