From 9ea5fdf42570f911e992e15b94576ed3a0274322 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 28 Jan 2025 16:34:07 -0500 Subject: [PATCH] Further improve the MFA process, now when verification fails the modal will stay open and the secret remain the same --- modals/user_mfa_modal.php | 13 ++++++++----- post/user/profile.php | 23 ++++++++++++++++++++--- user_security.php | 21 +++++++++++++++++++++ 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/modals/user_mfa_modal.php b/modals/user_mfa_modal.php index a5f9987b..7808299d 100644 --- a/modals/user_mfa_modal.php +++ b/modals/user_mfa_modal.php @@ -1,8 +1,12 @@ "; + // Clear it so it doesn't persist on refresh + unset($_SESSION['alert_type']); + unset($_SESSION['alert_message']); +} + +// If the user just failed a TOTP verification, auto-open the modal: +if (!empty($_SESSION['show_mfa_modal'])) { + echo " + "; + unset($_SESSION['show_mfa_modal']); +} + require_once "includes/footer.php";