Skip to content

Commit

Permalink
set last_login_utc inside mfa
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbitronics committed Sep 20, 2024
1 parent 0f3f515 commit 73d996c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/mfa/src/Auth/Process/Mfa.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ public static function validateMfaSubmission(
$mfaSubmission,
$rpOrigin
);

if ($mfaDataFromBroker === true || count($mfaDataFromBroker) > 0) {
$user = $idBrokerClient->updateUserLastLogin($employeeId);
print("User: $user->employee_id last login updated to: $user->last_login_utc");
}
} catch (\Throwable $t) {
$message = 'Something went wrong while we were trying to do the '
. '2-step verification.';
Expand Down Expand Up @@ -697,6 +702,8 @@ public static function isRememberMeCookieValid(
$expectedString = self::generateRememberMeCookieString($rememberSecret, $state['employeeId'], $expireDate, $mfaOptions);
return password_verify($expectedString, $cookieHash);
}
$idBrokerClient = self::getIdBrokerClient($state['idBrokerConfig']);
$idBrokerClient->updateUserLastLogin($state['employeeId']);
}

return false;
Expand Down

0 comments on commit 73d996c

Please sign in to comment.