Fix undefined verify_totp function in login.php and add TOTP helper functions; enhance debug diagnostics

This commit is contained in:
2026-09-09 18:03:56 +02:00
parent dfaa8ba7a8
commit 0b9e92eded
3 changed files with 26 additions and 6 deletions
+14
View File
@@ -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);
}
}