feat: logout button

This commit is contained in:
2024-12-20 21:56:37 +01:00
parent a6490fc180
commit 25672130cd
3 changed files with 19 additions and 10 deletions
+5 -1
View File
@@ -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>
+8
View File
@@ -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>