Private
Public Access
1
0

Fix stale nav after login/register: use full page navigation

goto() does client-side navigation which caches the layout data
(user is still null). Using window.location.href forces a full
server round-trip so the nav bar reflects the authenticated user.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Catherine Renelle
2026-02-26 20:28:48 -05:00
parent 80641b6058
commit 029b467eae
2 changed files with 2 additions and 6 deletions
+1 -3
View File
@@ -1,6 +1,4 @@
<script lang="ts">
import { goto } from '$app/navigation';
let email = $state('');
let password = $state('');
let error = $state('');
@@ -24,7 +22,7 @@
return;
}
goto('/boards');
window.location.href = '/boards';
} catch {
error = 'Network error. Please try again.';
} finally {
+1 -3
View File
@@ -1,6 +1,4 @@
<script lang="ts">
import { goto } from '$app/navigation';
let name = $state('');
let email = $state('');
let password = $state('');
@@ -25,7 +23,7 @@
return;
}
goto('/boards');
window.location.href = '/boards';
} catch {
error = 'Network error. Please try again.';
} finally {