mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 06:01:35 +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\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
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();
|
$error = $authenticationUtils->getLastAuthenticationError();
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$this->addFlash('danger', $error->getMessage());
|
$this->addFlash('danger', $error->getMessage());
|
||||||
|
#$this->addFlash('info', $translator->trans('Code:%code%',['%code%'=>$error->getMessageKey()]));
|
||||||
}else{
|
}else{
|
||||||
$lastUsername = $authenticationUtils->getLastUsername();
|
$lastUsername = $authenticationUtils->getLastUsername();
|
||||||
if($lastUsername){
|
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",[
|
return $this->render("user/login.html.twig",[
|
||||||
'last_username'=>$authenticationUtils->getLastUsername(),
|
'last_username'=>$authenticationUtils->getLastUsername(),
|
||||||
]);
|
]);
|
||||||
|
Loading…
Reference in New Issue
Block a user