feat: Redirect to current page after logout for better UX

- Updated logout handler to return user to current page instead of login
- Consistent with login behavior which redirects back to original page
- Allows users to continue browsing after logout without forced redirect
- Users who accidentally click logout can easily log back in and continue

This improves UX by keeping users on the page they were viewing,
rather than forcing them to the login page when they may have just
wanted to log out temporarily.

🤖 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:26:22 -05:00
parent cee37c78c4
commit 160a4e58b3

View File

@@ -145,8 +145,11 @@ const toggleMenu = () => {
const handleLogout = async () => {
isOpen.value = false
const currentPath = props.currentPath || route.fullPath
await $fetch('/api/auth/logout', { method: 'POST' })
await navigateTo('/login')
// Redirect back to the current page so user can continue browsing
await navigateTo(currentPath)
}
// Close menu when clicking outside