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

Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit f0e8fce

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Guard/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