|
|
|
@ -10,6 +10,10 @@ export function useGlobalActions(state: State): Actions {
|
|
|
|
|
const signOut: Actions['signOut'] = async () => { |
|
|
|
|
state.token.value = null |
|
|
|
|
state.user.value = null |
|
|
|
|
try { |
|
|
|
|
const nuxtApp = useNuxtApp() |
|
|
|
|
await nuxtApp.$api.auth.signout() |
|
|
|
|
} catch {} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 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')) |
|
|
|
|
await signOut() |
|
|
|
|
}) |
|
|
|
|
.finally(() => resolve()) |
|
|
|
|
.finally(() => resolve(true)) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|