Browse Source

fix(nc-gui): add back signout api

pull/5458/head
Wing-Kam Wong 2 years ago
parent
commit
000a39f19d
  1. 6
      packages/nc-gui/composables/useGlobal/actions.ts

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

@ -10,6 +10,10 @@ export function useGlobalActions(state: State): Actions {
const signOut: Actions['signOut'] = async () => { const signOut: Actions['signOut'] = async () => {
state.token.value = null state.token.value = null
state.user.value = null state.user.value = null
try {
const nuxtApp = useNuxtApp()
await nuxtApp.$api.auth.signout()
} catch {}
} }
/** Sign in by setting the token in localStorage */ /** Sign in by setting the token in localStorage */
@ -46,7 +50,7 @@ export function useGlobalActions(state: State): Actions {
message.error(err.message || t('msg.error.youHaveBeenSignedOut')) message.error(err.message || t('msg.error.youHaveBeenSignedOut'))
await signOut() await signOut()
}) })
.finally(() => resolve()) .finally(() => resolve(true))
}) })
} }

Loading…
Cancel
Save