Skip to content

Commit

Permalink
bug symfony/symfony#39878 [doctrine-bridge] Add username to UserNameN…
Browse files Browse the repository at this point in the history
…otFoundException
  • Loading branch information
qurben committed Jan 19, 2021
1 parent cee6b60 commit 6934747
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Provider/GuardAuthenticationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ private function authenticateViaGuard(AuthenticatorInterface $guardAuthenticator
$user = $guardAuthenticator->getUser($token->getCredentials(), $this->userProvider);

if (null === $user) {
throw new UsernameNotFoundException(sprintf('Null returned from "%s::getUser()".', \get_class($guardAuthenticator)));
$e = new UsernameNotFoundException(sprintf('Null returned from "%s::getUser()".', \get_class($guardAuthenticator)));
$e->setUsername($token->getUsername());

throw $e;
}

if (!$user instanceof UserInterface) {
Expand Down

0 comments on commit 6934747

Please sign in to comment.