Skip to content

Commit

Permalink
Make sure we’re saving the last_login in 2FA auths
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <[email protected]>
  • Loading branch information
snipe committed Feb 27, 2025
1 parent 30c4e9d commit 23ce54e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ private function loginViaLdap(Request $request): User
$user->password = bcrypt($request->input('password'));
}

$user->last_login = \Carbon::now();
$user->email = $ldap_attr['email'];
$user->first_name = $ldap_attr['firstname'];
$user->last_name = $ldap_attr['lastname']; //FIXME (or TODO?) - do we need to map additional fields that we now support? E.g. country, phone, etc.
Expand Down Expand Up @@ -432,6 +433,7 @@ public function postTwoFactorAuth(Request $request)

if (Google2FA::verifyKey($user->two_factor_secret, $secret)) {
$user->two_factor_enrolled = 1;
$user->last_login = \Carbon::now();
$user->saveQuietly();
$request->session()->put('2fa_authed', $user->id);

Expand Down

0 comments on commit 23ce54e

Please sign in to comment.