File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed
Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -226,11 +226,11 @@ public function getPasswordHash(): ?string
226226 /**
227227 * Returns the last login information for this user as
228228 */
229- public function lastLogin (bool $ allowFailed = false ): ?Login
229+ public function lastLogin (): ?Login
230230 {
231231 /** @var LoginModel $logins */
232232 $ logins = model (LoginModel::class);
233233
234- return $ logins ->lastLogin ($ this , $ allowFailed );
234+ return $ logins ->lastLogin ($ this );
235235 }
236236}
Original file line number Diff line number Diff line change @@ -61,17 +61,12 @@ public function recordLoginAttempt(
6161 /**
6262 * Returns the last login information for the user
6363 */
64- public function lastLogin (User $ user, bool $ allowFailed = false ): ?Login
64+ public function lastLogin (User $ user ): ?Login
6565 {
66- if (! $ allowFailed ) {
67- $ this ->where ('success ' , 1 )
68- ->where ('user_id ' , $ user ->id );
69- } else {
70- $ this ->where ('identifier ' , $ user ->email )
71- ->orWhere ('identifier ' , $ user ->username );
72- }
73-
74- return $ this ->orderBy ('date ' , 'desc ' )->first ();
66+ return $ this ->where ('success ' , 1 )
67+ ->where ('user_id ' , $ user ->id )
68+ ->orderBy ('date ' , 'desc ' )
69+ ->first ();
7570 }
7671
7772 /**
You can’t perform that action at this time.
0 commit comments