Improve error handling and feedback for password reset functionality
This commit is contained in:
@@ -53,12 +53,21 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
// Verstuur herstelmail via de nieuwe FocizMailer
|
// Verstuur herstelmail via de nieuwe FocizMailer
|
||||||
$mailResult = FocizMailer::sendPasswordResetEmail($user['email'], $user['name'], $resetUrl);
|
$mailResult = FocizMailer::sendPasswordResetEmail($user['email'], $user['name'], $resetUrl);
|
||||||
if (!$mailResult['success']) {
|
if (!$mailResult['success']) {
|
||||||
error_log("Fout bij verzenden wachtwoordherstel mail naar {$email}: " . ($mailResult['error'] ?? 'Onbekend'));
|
$errMsg = $mailResult['error'] ?? 'Mailserver fout';
|
||||||
}
|
error_log("Fout bij verzenden wachtwoordherstel mail naar {$email}: {$errMsg}");
|
||||||
}
|
$error = "De herstelmail kon niet worden verzonden via de mailserver: " . htmlspecialchars($errMsg);
|
||||||
|
} else {
|
||||||
// Anti-enumeratie: Toon altijd succes ongeacht of het e-mailadres bestaat
|
|
||||||
$submitted = true;
|
$submitted = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// In development omgeving geven we directe diagnostische feedback
|
||||||
|
if (defined('APP_ENV') && APP_ENV === 'development') {
|
||||||
|
$error = "Er is geen Fociz account gevonden met het e-mailadres '{$email}'. Controleer of dit e-mailadres correct is ingevoerd.";
|
||||||
|
} else {
|
||||||
|
// Anti-enumeratie op productie: toon altijd succes
|
||||||
|
$submitted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
error_log("Wachtwoord vergeten fout: " . $e->getMessage());
|
error_log("Wachtwoord vergeten fout: " . $e->getMessage());
|
||||||
|
|||||||
+1
-1
@@ -136,7 +136,7 @@ define('SMTP_PORT', (int)fociz_env('SMTP_PORT', 587));
|
|||||||
define('SMTP_USER', fociz_env('SMTP_USER', 'info@fociz.nl'));
|
define('SMTP_USER', fociz_env('SMTP_USER', 'info@fociz.nl'));
|
||||||
define('SMTP_PASS', fociz_env('SMTP_PASS', '6swpQSBg5uWFmjar7F6a'));
|
define('SMTP_PASS', fociz_env('SMTP_PASS', '6swpQSBg5uWFmjar7F6a'));
|
||||||
define('SMTP_SECURE', fociz_env('SMTP_SECURE', 'tls')); // 'tls' (STARTTLS port 587) of 'ssl' (port 465)
|
define('SMTP_SECURE', fociz_env('SMTP_SECURE', 'tls')); // 'tls' (STARTTLS port 587) of 'ssl' (port 465)
|
||||||
define('SMTP_FROM_EMAIL', fociz_env('SMTP_FROM_EMAIL', 'no-reply@fociz.nl'));
|
define('SMTP_FROM_EMAIL', fociz_env('SMTP_FROM_EMAIL', 'info@fociz.nl'));
|
||||||
define('SMTP_FROM_NAME', fociz_env('SMTP_FROM_NAME', 'Fociz'));
|
define('SMTP_FROM_NAME', fociz_env('SMTP_FROM_NAME', 'Fociz'));
|
||||||
define('SMTP_REPLY_TO', fociz_env('SMTP_REPLY_TO', 'info@fociz.nl'));
|
define('SMTP_REPLY_TO', fociz_env('SMTP_REPLY_TO', 'info@fociz.nl'));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user