Fix post-login/setup navigation: use hard redirect instead of goto
Some checks failed
Validate / Hassfest (push) Has been cancelled

goto('/') races with layout's onMount auth check, causing redirect
back to /login. Use window.location.href for full page reload which
re-initializes layout with authenticated state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 18:59:50 +03:00
parent 0bb4d8a949
commit 693c157c31
2 changed files with 2 additions and 2 deletions

View File

@@ -27,7 +27,7 @@
submitting = true; submitting = true;
try { try {
await login(username, password); await login(username, password);
goto('/'); window.location.href = '/';
} catch (err: any) { } catch (err: any) {
error = err.message || 'Login failed'; error = err.message || 'Login failed';
} }

View File

@@ -21,7 +21,7 @@
submitting = true; submitting = true;
try { try {
await setup(username, password); await setup(username, password);
goto('/'); window.location.href = '/';
} catch (err: any) { error = err.message || 'Setup failed'; } } catch (err: any) { error = err.message || 'Setup failed'; }
submitting = false; submitting = false;
} }