File tree 1 file changed +10
-0
lines changed
Authenticator/Passport/Badge 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 13
13
14
14
use Symfony \Component \Security \Core \Exception \AuthenticationException ;
15
15
use Symfony \Component \Security \Core \Exception \AuthenticationServiceException ;
16
+ use Symfony \Component \Security \Core \Exception \UserNotFoundException ;
16
17
use Symfony \Component \Security \Core \User \UserInterface ;
17
18
use Symfony \Component \Security \Http \EventListener \UserProviderListener ;
18
19
@@ -65,6 +66,15 @@ public function getUser(): UserInterface
65
66
}
66
67
67
68
$ this ->user = ($ this ->userLoader )($ this ->userIdentifier );
69
+
70
+ // No user has been found via the $this->userLoader callback
71
+ if (null === $ this ->user ) {
72
+ $ exception = new UserNotFoundException ();
73
+ $ exception ->setUserIdentifier ($ this ->userIdentifier );
74
+
75
+ throw $ exception ;
76
+ }
77
+
68
78
if (!$ this ->user instanceof UserInterface) {
69
79
throw new AuthenticationServiceException (sprintf ('The user provider must return a UserInterface object, "%s" given. ' , get_debug_type ($ this ->user )));
70
80
}
You can’t perform that action at this time.
0 commit comments