|
|
@ -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)) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|