feat: logout button
This commit is contained in:
+5
-1
@@ -74,10 +74,14 @@ onUnmounted(() => {
|
||||
<div class="background">
|
||||
<header>
|
||||
<ClientOnly>
|
||||
<template v-if="authStore.logged">
|
||||
<GamePlayerIcon
|
||||
v-if="authStore.logged"
|
||||
|
||||
:user="(authStore.selfUser as User)"
|
||||
/>
|
||||
<button @click="navigateTo('/logout')">Logout</button>
|
||||
</template>
|
||||
|
||||
<button v-else @click="navigateTo('/login')">Login</button>
|
||||
</ClientOnly>
|
||||
</header>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
const route = useRoute();
|
||||
const config = useRuntimeConfig();
|
||||
|
||||
const code = route.query.code;
|
||||
|
||||
navigateTo(config.public.endpoint + "/logout", { external: true });
|
||||
</script>
|
||||
Reference in New Issue
Block a user