2023-02-08 12:41:35 -08:00
|
|
|
<script lang="ts">
|
|
|
|
import { VIEWS } from '@/constants';
|
|
|
|
import { mapStores } from 'pinia';
|
2023-05-05 01:41:54 -07:00
|
|
|
import { useUsersStore } from '@/stores/users.store';
|
2023-05-12 07:43:34 -07:00
|
|
|
import mixins from 'vue-typed-mixins';
|
|
|
|
import { showMessage } from '@/mixins/showMessage';
|
2023-02-08 12:41:35 -08:00
|
|
|
|
2023-05-12 07:43:34 -07:00
|
|
|
export default mixins(showMessage).extend({
|
2023-02-08 12:41:35 -08:00
|
|
|
name: 'SignoutView',
|
|
|
|
computed: {
|
|
|
|
...mapStores(useUsersStore),
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async logout() {
|
|
|
|
try {
|
|
|
|
await this.usersStore.logout();
|
2023-05-10 08:10:03 -07:00
|
|
|
void this.$router.replace({ name: VIEWS.SIGNIN });
|
2023-02-08 12:41:35 -08:00
|
|
|
} catch (e) {
|
2023-05-12 07:43:34 -07:00
|
|
|
this.$showError(e, this.$locale.baseText('auth.signout.error'));
|
2023-02-08 12:41:35 -08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
2023-05-10 08:10:03 -07:00
|
|
|
void this.logout();
|
2023-02-08 12:41:35 -08:00
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div />
|
|
|
|
</template>
|