Setup: hard-nav to /login after account creation (server-component layout cache)

This commit is contained in:
Hendrik 2026-05-01 18:05:16 +02:00
parent 12c618399e
commit a5a8a89f20

View file

@ -22,10 +22,10 @@ export default function SetupPage() {
fetch("/api/setup")
.then((r) => r.json())
.then((d) => {
if (d.setup_complete) router.replace("/login");
if (d.setup_complete) window.location.replace("/login");
else setChecked(true);
});
}, [router]);
}, []);
async function handleSubmit(e: React.FormEvent) {
e.preventDefault();
@ -50,10 +50,9 @@ export default function SetupPage() {
setError(d.error || "Setup fehlgeschlagen.");
return;
}
router.replace("/login");
window.location.href = "/login";
} catch {
setError("Verbindungsfehler.");
} finally {
setLoading(false);
}
}