File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/Authentication/Authenticators Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1010use CodeIgniter \Shield \Authentication \AuthenticatorInterface ;
1111use CodeIgniter \Shield \Authentication \Passwords ;
1212use CodeIgniter \Shield \Entities \User ;
13+ use CodeIgniter \Shield \Exceptions \LogicException ;
1314use CodeIgniter \Shield \Models \LoginModel ;
1415use CodeIgniter \Shield \Models \RememberModel ;
1516use CodeIgniter \Shield \Models \UserIdentityModel ;
@@ -113,9 +114,11 @@ public function attempt(array $credentials): Result
113114 */
114115 public function checkAction (string $ type , string $ token ): bool
115116 {
116- $ user = $ this ->loggedIn ()
117- ? $ this ->getUser ()
118- : null ;
117+ $ user = $ this ->loggedIn () ? $ this ->getUser () : null ;
118+
119+ if ($ user === null ) {
120+ throw new LogicException ('Cannot get the User. ' );
121+ }
119122
120123 $ identity = $ user ->getIdentity ($ type );
121124
You can’t perform that action at this time.
0 commit comments