feat (gestion exceptions) #19: traitement retour: typage, un seul message pour erreur login ou mdp
Some checks reported warnings
Cadoles/hydra-sql/pipeline/pr-develop This commit is unstable

This commit is contained in:
2024-04-29 10:44:38 +02:00
parent 3e45119684
commit 0791727694
6 changed files with 23 additions and 32 deletions

View File

@ -29,11 +29,11 @@ class SecurityController extends AbstractController
$error = $authenticationUtils->getLastAuthenticationError();
if ($error) {
if ($request->getSession()->has(SQLLoginUserAuthenticator::ERROR_LOGIN)) {
$loginForm->get('login')->addError(new FormError($trans->trans('error.login', [], 'messages')));
$loginForm->addError(new FormError($trans->trans('error.login', [], 'messages')));
$request->getSession()->remove(SQLLoginUserAuthenticator::ERROR_LOGIN);
}
if ($request->getSession()->has(SQLLoginUserAuthenticator::ERROR_PASSWORD)) {
$loginForm->get('password')->addError(new FormError($trans->trans('error.password', [], 'messages')));
$loginForm->addError(new FormError($trans->trans('error.login', [], 'messages')));
$request->getSession()->remove(SQLLoginUserAuthenticator::ERROR_PASSWORD);
}
if ($request->getSession()->has(SQLLoginUserAuthenticator::ERROR_PDO)) {