2023-04-25 15:51:20 +02:00
|
|
|
<template>
|
2023-05-06 13:14:01 +02:00
|
|
|
<div class="flex items-center border-b border-b-gray-700 bg-neutral-800 px-5">
|
|
|
|
<h1 class="text-2xl font-bold text-primary">Polarcraft</h1>
|
2023-04-25 15:51:20 +02:00
|
|
|
<Button outline class="ml-auto" @click="logout">Logout</Button>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
const logout = async () => {
|
|
|
|
try {
|
|
|
|
await useFetch('/api/auth/logout')
|
|
|
|
|
|
|
|
navigateTo('/login')
|
|
|
|
} catch (err) {
|
|
|
|
console.log(err)
|
|
|
|
alert(err.statusMessage)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|