mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-08 13:51:34 +01:00
Implemented some messages
This commit is contained in:
parent
e84d43b3f1
commit
2597529f01
@ -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(),
|
||||
]);
|
||||
|
Loading…
Reference in New Issue
Block a user