feat (gestion exception) #19: modification fetchPassword
Some checks reported warnings
Cadoles/hydra-sql/pipeline/pr-develop This commit is unstable

This commit is contained in:
2024-04-29 11:09:58 +02:00
parent 0791727694
commit 51c92a0dba
3 changed files with 43 additions and 44 deletions

View File

@ -17,7 +17,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class SecurityController extends AbstractController
{
#[Route('/login', name: 'app_login')]
public function login(ParameterBagInterface $params, AuthenticationUtils $authenticationUtils, Request $request, TranslatorInterface $trans): Response
public function login(ParameterBagInterface $params, AuthenticationUtils $authenticationUtils, Request $request, TranslatorInterface $trans): Response|RedirectResponse
{
// Si l'utilisateur est déjà connecté on le renvoie sur la page du site demandeur
if ($this->getUser()) {
@ -32,10 +32,6 @@ class SecurityController extends AbstractController
$loginForm->addError(new FormError($trans->trans('error.login', [], 'messages')));
$request->getSession()->remove(SQLLoginUserAuthenticator::ERROR_LOGIN);
}
if ($request->getSession()->has(SQLLoginUserAuthenticator::ERROR_PASSWORD)) {
$loginForm->addError(new FormError($trans->trans('error.login', [], 'messages')));
$request->getSession()->remove(SQLLoginUserAuthenticator::ERROR_PASSWORD);
}
if ($request->getSession()->has(SQLLoginUserAuthenticator::ERROR_PDO)) {
$loginForm->addError(new FormError($trans->trans('error.pdo', [], 'messages')));
$request->getSession()->remove(SQLLoginUserAuthenticator::ERROR_PDO);