Skip to content
Permalink
Browse files

refactor: Fixed psalm errors.

  • Loading branch information...
tarlepp committed Jun 27, 2019
1 parent 118cacf commit abbe935f2caca9582c7d4c5b889937ea6e4dbdc6
@@ -88,10 +88,12 @@ public static function getSubscribedEvents(): array
*/
public function onAuthenticationFailure(AuthenticationFailureEvent $event): void
{
$token = $event->getException()->getToken();
// Fetch user entity
if (is_string($event->getException()->getToken()->getUser())) {
if ($token !== null && is_string($token->getUser())) {
/** @var string $username */
$username = $event->getException()->getToken()->getUser();
$username = $token->getUser();
$this->loginLogger->setUser($this->userRepository->loadUserByUsername($username));
}
@@ -100,7 +100,13 @@ public static function getSubscribedEvents(): array
*/
public function onAuthenticationFailure(AuthenticationFailureEvent $event): void
{
$user = $this->getUser($event->getException()->getToken()->getUser());
$token = $event->getException()->getToken();
if ($token === null) {
return;
}
$user = $this->getUser($token->getUser());
if ($user instanceof User) {
$this->checkLockedAccount($user, $event);

0 comments on commit abbe935

Please sign in to comment.
You can’t perform that action at this time.