Fix logout cleanup
This commit is contained in:
parent
14115749a8
commit
171bc5932e
|
@ -97,12 +97,6 @@ export async function onLogin(apolloClient, token) {
|
|||
|
||||
// Manually call this when user log out
|
||||
export async function onLogout(apolloClient) {
|
||||
if (typeof localStorage !== 'undefined') {
|
||||
localStorage.removeItem(AUTH_TOKEN)
|
||||
}
|
||||
|
||||
if (apolloClient.wsClient) restartWebsockets(apolloClient.wsClient)
|
||||
|
||||
try {
|
||||
await apolloClient.resetStore()
|
||||
} catch (e) {
|
||||
|
@ -110,6 +104,12 @@ export async function onLogout(apolloClient) {
|
|||
console.log('%cError on cache reset (logout)', 'color: orange;', e.message)
|
||||
}
|
||||
|
||||
if (apolloClient.wsClient) restartWebsockets(apolloClient.wsClient)
|
||||
|
||||
if (typeof localStorage !== 'undefined') {
|
||||
localStorage.removeItem(AUTH_TOKEN)
|
||||
}
|
||||
|
||||
await router.push('login')
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user