fixing ui
Deploy / deploy (push) Successful in 31s

This commit is contained in:
2026-05-06 09:40:19 +02:00
parent ef8c864f2b
commit a6968d7f71
+7 -2
View File
@@ -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.');
}
}