Browse Source

fix(nc-gui): reset state token and user after signout

pull/5905/head
Wing-Kam Wong 1 year ago
parent
commit
df7ee748c5
  1. 8
      packages/nc-gui/composables/useGlobal/actions.ts

8
packages/nc-gui/composables/useGlobal/actions.ts

@ -8,12 +8,14 @@ export function useGlobalActions(state: State): Actions {
/** Sign out by deleting the token from localStorage */
const signOut: Actions['signOut'] = async () => {
state.token.value = null
state.user.value = null
try {
const nuxtApp = useNuxtApp()
await nuxtApp.$api.auth.signout()
} catch {}
} catch {
} finally {
state.token.value = null
state.user.value = null
}
}
/** Sign in by setting the token in localStorage */

Loading…
Cancel
Save