mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-02 06:10:14 +02:00
Track which mechanism was used when successfully providing OTP for 2FA
This commit is contained in:
@@ -836,6 +836,7 @@ final class Auth extends UserManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$success = false;
|
$success = false;
|
||||||
|
$mechanismUsed = null;
|
||||||
$performTotpVerification = true;
|
$performTotpVerification = true;
|
||||||
|
|
||||||
if (!empty($otpRecords)) {
|
if (!empty($otpRecords)) {
|
||||||
@@ -868,6 +869,7 @@ final class Auth extends UserManager {
|
|||||||
|
|
||||||
// remember that we have successfully verified the one-time password now
|
// remember that we have successfully verified the one-time password now
|
||||||
$success = true;
|
$success = true;
|
||||||
|
$mechanismUsed = (int) $otpRecord['mechanism'];
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -915,6 +917,7 @@ final class Auth extends UserManager {
|
|||||||
|
|
||||||
// remember that we have successfully verified the one-time password now
|
// remember that we have successfully verified the one-time password now
|
||||||
$success = true;
|
$success = true;
|
||||||
|
$mechanismUsed = self::TWO_FACTOR_MECHANISM_TOTP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user