fix: Skip Setup button no longer traps users when unauthenticated
CI / Test & Lint (push) Canceled after 0s
CI / Security audit (push) Canceled after 0s

The Skip button awaited saveConfigToServer() which fails with 403
when TOTP is required, preventing the wizard from dismissing.
Fix: hide wizard FIRST (localStorage-only), then fire server save
as fire-and-forget with .catch().
This commit is contained in:
Hermes
2026-08-13 14:34:00 -07:00
parent 56c976a935
commit 70209cdf0c
2 changed files with 5 additions and 4 deletions
+2 -2
View File
File diff suppressed because one or more lines are too long
+3 -2
View File
@@ -252,10 +252,11 @@ window.populateTimezoneSelect = function(selectEl, selectedTz) {
skipBtn.onclick = async function(e) {
e.preventDefault();
if (confirm('Skip setup? You can run it later from Settings.')) {
// Save skip status to server
await saveConfigToServer({ setupComplete: true, skipped: true, timestamp: new Date().toISOString() });
// Save skip status — hide wizard FIRST so it always dismisses,
// then attempt server save (fire-and-forget, never blocks UI)
safeSet('dashcaddy-setup', 'skipped');
document.getElementById('setup-wizard').style.display = 'none';
saveConfigToServer({ setupComplete: true, skipped: true, timestamp: new Date().toISOString() }).catch(() => {});
}
};
}