mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Fixed phpstan issue
This commit is contained in:
parent
f0519ae0b3
commit
08e7e3f2bf
1 changed files with 4 additions and 1 deletions
|
@ -27,6 +27,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
|||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Security\Core\Exception\AuthenticationException;
|
||||
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
|
||||
|
@ -60,7 +61,9 @@ class AuthenticationEntryPoint implements AuthenticationEntryPointInterface
|
|||
//Otherwise we redirect to the login page
|
||||
|
||||
//Add a nice flash message to make it clear what happened
|
||||
$request->getSession()->getFlashBag()->add('error', t('login.flash.access_denied_please_login'));
|
||||
if ($request->getSession() instanceof Session) {
|
||||
$request->getSession()->getFlashBag()->add('error', t('login.flash.access_denied_please_login'));
|
||||
}
|
||||
|
||||
return new RedirectResponse($this->urlGenerator->generate('login'));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue