Fix undefined verify_totp function in login.php and add TOTP helper functions; enhance debug diagnostics
This commit is contained in:
@@ -130,3 +130,17 @@ class TOTP {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Globale helper functies voor 2FA TOTP verificatie
|
||||
*/
|
||||
if (!function_exists('verify_totp')) {
|
||||
function verify_totp(string $secret, string $userInputCode, int $window = 1): bool {
|
||||
return TOTP::verifyCode($secret, $userInputCode, $window);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('get_totp_code')) {
|
||||
function get_totp_code(string $secret, ?int $timestamp = null): string {
|
||||
return TOTP::getCode($secret, $timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user