10000 bug symfony/symfony#39878 [doctrine-bridge] Add username to UserNameN… · symfony/security-guard@6934747 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6934747

Browse files
committed
bug symfony/symfony#39878 [doctrine-bridge] Add username to UserNameNotFoundException
1 parent cee6b60 commit 6934747

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Provider/GuardAuthenticationProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ private function authenticateViaGuard(AuthenticatorInterface $guardAuthenticator
105105
$user = $guardAuthenticator->getUser($token->getCredentials(), $this->userProvider);
106106

107107
if (null === $user) {
108-
throw new UsernameNotFoundException(sprintf('Null returned from "%s::getUser()".', \get_class($guardAuthenticator)));
108+
$e = new UsernameNotFoundException(sprintf('Null returned from "%s::getUser()".', \get_class($guardAuthenticator)));
109+
$e->setUsername($token->getUsername());
110+
111+
throw $e;
109112
}
110113

111114
if (!$user instanceof UserInterface) {

0 commit comments

Comments
 (0)
0