fix toggleRecovery text
This commit is contained in:
@@ -55,12 +55,23 @@ export function openTOTPLoginModal() {
|
||||
});
|
||||
|
||||
// Toggle between TOTP and Recovery
|
||||
document.getElementById("toggleRecovery").addEventListener("click", e => {
|
||||
document.getElementById("toggleRecovery").addEventListener("click", function (e) {
|
||||
e.preventDefault();
|
||||
document.getElementById("totpSection").style.display =
|
||||
document.getElementById("recoverySection").style.display === "none" ? "none" : "block";
|
||||
document.getElementById("recoverySection").style.display =
|
||||
document.getElementById("recoverySection").style.display === "none" ? "block" : "none";
|
||||
const totpSection = document.getElementById("totpSection");
|
||||
const recoverySection = document.getElementById("recoverySection");
|
||||
const toggleLink = this;
|
||||
|
||||
if (recoverySection.style.display === "none") {
|
||||
// Switch to recovery
|
||||
totpSection.style.display = "none";
|
||||
recoverySection.style.display = "block";
|
||||
toggleLink.textContent = "Use TOTP Code instead";
|
||||
} else {
|
||||
// Switch back to TOTP
|
||||
recoverySection.style.display = "none";
|
||||
totpSection.style.display = "block";
|
||||
toggleLink.textContent = "Use Recovery Code instead";
|
||||
}
|
||||
});
|
||||
|
||||
// Recovery submission
|
||||
@@ -409,7 +420,7 @@ export function closeTOTPModal(disable = true) {
|
||||
})
|
||||
.catch(() => { showToast("Error disabling TOTP setting."); });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function openAdminPanel() {
|
||||
fetch("getConfig.php", { credentials: "include" })
|
||||
|
||||
Reference in New Issue
Block a user