Fix undefined verify_totp function in login.php and add TOTP helper functions; enhance debug diagnostics
This commit is contained in:
+6
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user