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
+6 -1
View File
@@ -81,7 +81,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Controleer reguliere TOTP code
if (!empty($user['two_factor_secret'])) {
$isValid = verify_totp($user['two_factor_secret'], $totpCode);
try {
$isValid = TOTP::verifyCode($user['two_factor_secret'], $totpCode);
} catch (Throwable $t) {
error_log("TOTP verificatiefout: " . $t->getMessage());
$isValid = false;
}
}
// Fallback: controleer 8-karakter backup codes