fix(console): make logout deterministic and redirect to account switch login

This commit is contained in:
Haitao Pan 2026-02-05 23:15:41 +08:00
parent 34622a4afa
commit ca90e45a8c
2 changed files with 2 additions and 3 deletions

View File

@ -22,7 +22,7 @@ export function LogoutClient() {
await logout()
} finally {
if (!cancelled) {
router.replace('/')
router.replace('/login?switch=1')
router.refresh()
}
}

View File

@ -385,8 +385,7 @@ export const useUserStore = create<UserStore>((set, get) => ({
} catch (error) {
console.warn('Failed to clear user session', error)
}
await get().hydrateFromAPI()
set({ user: null, isLoading: false })
},
}))