mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-08 19:37:29 -08:00
31 lines
702 B
Vue
31 lines
702 B
Vue
<script setup lang="ts">
|
|
import { VIEWS } from '@/constants';
|
|
import { useUsersStore } from '@/stores/users.store';
|
|
import { useToast } from '@/composables/useToast';
|
|
import { useRouter } from 'vue-router';
|
|
import { useI18n } from '@/composables/useI18n';
|
|
import { onMounted } from 'vue';
|
|
|
|
const usersStore = useUsersStore();
|
|
const toast = useToast();
|
|
const router = useRouter();
|
|
const i18n = useI18n();
|
|
|
|
const logout = async () => {
|
|
try {
|
|
await usersStore.logout();
|
|
window.location.href = router.resolve({ name: VIEWS.SIGNIN }).href;
|
|
} catch (e) {
|
|
toast.showError(e, i18n.baseText('auth.signout.error'));
|
|
}
|
|
};
|
|
|
|
onMounted(() => {
|
|
void logout();
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<div />
|
|
</template>
|