diff --git a/application/src/Controller/SecurityController.php b/application/src/Controller/SecurityController.php index ef678b4..f770f15 100644 --- a/application/src/Controller/SecurityController.php +++ b/application/src/Controller/SecurityController.php @@ -6,6 +6,9 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; +use Symfony\Component\HttpFoundation\Request; +use App\Entity\User; /** * @@ -23,13 +26,13 @@ class SecurityController extends AbstractController $error = $authenticationUtils->getLastAuthenticationError(); if ($error) { $this->addFlash('danger', $error->getMessage()); + #$this->addFlash('info', $translator->trans('Code:%code%',['%code%'=>$error->getMessageKey()])); }else{ $lastUsername = $authenticationUtils->getLastUsername(); if($lastUsername){ - $this->addFlash('success', $translator->trans('User %user% loged in.',['user'=>$lastUsername])); + $this->addFlash('success', $translator->trans('User %user% loged in.',['%user%'=>$lastUsername])); } } - $this->addFlash('info', $authenticationUtils->getLastUsername()); return $this->render("user/login.html.twig",[ 'last_username'=>$authenticationUtils->getLastUsername(), ]);