feat(User): Add Logout
parent
470efe6956
commit
5892921a7c
|
|
@ -23,7 +23,7 @@ const links = [{
|
||||||
|
|
||||||
<template #right>
|
<template #right>
|
||||||
<UColorModeButton />
|
<UColorModeButton />
|
||||||
<UButton to="#" target="_blank" icon="i-heroicons-user-solid" color="gray" variant="ghost" />
|
<UserDropdown />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #panel>
|
<template #panel>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
const links = [{
|
||||||
|
label: 'Logout',
|
||||||
|
to: '/logout',
|
||||||
|
icon: 'i-heroicons-arrow-left-on-rectangle',
|
||||||
|
}]
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<UPopover>
|
||||||
|
<UButton icon="i-heroicons-user-solid" color="gray" variant="ghost" />
|
||||||
|
<template #panel>
|
||||||
|
<div class="p-4">
|
||||||
|
<UNavigationLinks :links="links" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</UPopover>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
definePageMeta({ middleware: ['auth'] })
|
||||||
|
const { logout } = useAuth()
|
||||||
|
logout()
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue