fix: Force page reload after logout to refresh authentication state
- Changed logout to use window.location.href for full page reload - Ensures all components refresh and show correct unauthenticated state - Fixes issue where logout appeared to do nothing until manual refresh - Menu, notes section, and all auth-dependent UI now update immediately Previously, using navigateTo() to the same page didn't trigger a refresh, leaving stale authenticated UI visible. Full page reload ensures clean state. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -148,8 +148,11 @@ const handleLogout = async () => {
|
|||||||
const currentPath = props.currentPath || route.fullPath
|
const currentPath = props.currentPath || route.fullPath
|
||||||
await $fetch('/api/auth/logout', { method: 'POST' })
|
await $fetch('/api/auth/logout', { method: 'POST' })
|
||||||
|
|
||||||
// Redirect back to the current page so user can continue browsing
|
// Force a full page reload to refresh authentication state
|
||||||
await navigateTo(currentPath)
|
// This ensures all components update correctly
|
||||||
|
if (import.meta.client) {
|
||||||
|
window.location.href = currentPath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close menu when clicking outside
|
// Close menu when clicking outside
|
||||||
|
|||||||
Reference in New Issue
Block a user