feat: Enhance logout functionality and routing in authentication system
- Integrate `useRouter` in `UserProfile.vue` and `useAuth.ts` to manage navigation after logout. - Update `handleLogout` in `Navbar.vue` to reflect that redirection is now handled within the `auth.logout()` function.
This commit is contained in:
parent
31fe244089
commit
6e653d584c
3 changed files with 7 additions and 0 deletions
|
|
@ -43,6 +43,7 @@ const handleLogout = async () => {
|
|||
try {
|
||||
await auth.logout()
|
||||
isOpen.value = false
|
||||
// The redirect is now handled in the auth.logout() function
|
||||
} catch (error) {
|
||||
console.error('Logout failed:', error)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue