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:
@@ -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,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 {
|
||||
|
||||
Reference in New Issue
Block a user