redirection pour le crud de l'utilisateur en tant qu'admin fonctionnel

This commit is contained in:
sermandm 2025-04-18 11:11:05 +02:00
parent 1d03855c8a
commit 75e47bacc0
4 changed files with 7 additions and 7 deletions

View File

@ -14,14 +14,14 @@ security:
lazy: true
provider: app_user_provider
form_login:
login_path: _login
check_path: _login
login_path: app_login
check_path: app_login
success_handler: App\Security\CustomAuthenticationSuccessHandler
enable_csrf: true
csrf_token_id: authenticate
logout:
path: _logout
target: _login
path: app_logout
target: app_login
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall

View File

@ -17,7 +17,7 @@ final class UserController extends AbstractController
#[Route(name: 'app_user_index', methods: ['GET'])]
public function index(UserRepository $userRepository): Response
{
return $this->render('user/admin.html.twig', [
return $this->render('user/index.html.twig', [
'users' => $userRepository->findAll(),
]);
}

View File

@ -40,7 +40,7 @@
<li><a href="{{ path('stock_index') }}">Pièces détachées</a></li>
{% endif %}
<li><a href="{{ path('_logout') }}">Déconnexion</a></li>
<li><a href="{{ path('app_logout') }}">Déconnexion</a></li>
</ul>
</nav>
{% endif %}

View File

@ -25,7 +25,7 @@
<img class="logoProfile" src="{{ asset('styles/image/profile.png') }}" alt="Logo Profil">
<img class="logoPassword" src="{{ asset('styles/image/password.png') }}" alt="Logo Password">
<form method="post" action="{{ path('_login') }}">
<form method="post" action="{{ path('app_login') }}">
{% if error %}
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}