chargement propre pour le login

This commit is contained in:
ragueneaul 2025-04-18 09:47:40 +02:00
parent fa114ce6a5
commit d7b1aa6692
3 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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.');

View File

@ -32,7 +32,7 @@
{% if app.user %}
<div class="mb-3">
Vous êtes connecté en tant que {{ app.user.userIdentifier }}, <a href="{{ path('app_logout') }}">Déconnexion</a>
Vous êtes connecté en tant que {{ app.user.userIdentifier }}, <a href="{{ path('_logout') }}">Déconnexion</a>
</div>
{% endif %}
<label>