refactor components and notifications bug
This commit is contained in:
20
components/UserAccount/UserAccountSignout.client.vue
Normal file
20
components/UserAccount/UserAccountSignout.client.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
const supabase = useSupabaseAuthClient();
|
||||
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>
|
||||
Reference in New Issue
Block a user