From a6968d7f71fb90e1c176f21963828429fa030a5c Mon Sep 17 00:00:00 2001 From: janis steiner Date: Wed, 6 May 2026 09:40:19 +0200 Subject: [PATCH] fixing ui --- app-code/account/index.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app-code/account/index.php b/app-code/account/index.php index 7ee6d52..be99ca8 100644 --- a/app-code/account/index.php +++ b/app-code/account/index.php @@ -483,12 +483,17 @@ if (!isset($_SESSION["logged_in"]) || $_SESSION["logged_in"] !== true) { }), }); const result = await response.json(); + const twofaSwitch = document.getElementById('twofa-switch'); if (response.ok && result.success) { bootstrap.Modal.getInstance(document.getElementById('twofaModal')).hide(); - document.getElementById('2fa-switch').checked = true; + if (twofaSwitch) { + twofaSwitch.checked = true; + } showSuccessModal(result.message || '2FA enabled successfully.'); } else { - document.getElementById('2fa-switch').checked = false; + if (twofaSwitch) { + twofaSwitch.checked = false; + } showErrorModal(result.message || 'Invalid 2FA code.'); } }