Files
afrobiz/components/UserAccount/UserAccountSignout.client.vue
2023-11-06 20:09:08 +11:00

20 lines
426 B
Vue

<script setup lang="ts">
const supabase = useSupabaseClient();
const accountStore = useAccountStore();
onMounted(async () => {
await accountStore.init();
});
async function signout() {
await supabase.auth.signOut();
if (accountStore) {
accountStore.signout();
}
navigateTo('/', { replace: true });
}
</script>
<template>
<a href="#" @click.prevent="signout()">Signout</a>
</template>