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:
2025-11-06 10:56:08 -05:00
parent d8fd24c6b1
commit bcacf7d513

View File

@@ -148,8 +148,11 @@ const handleLogout = async () => {
const currentPath = props.currentPath || route.fullPath
await $fetch('/api/auth/logout', { method: 'POST' })
// Redirect back to the current page so user can continue browsing
await navigateTo(currentPath)
// Force a full page reload to refresh authentication state
// This ensures all components update correctly
if (import.meta.client) {
window.location.href = currentPath
}
}
// Close menu when clicking outside