Compare commits
2 Commits
9fc830a98b
...
5892921a7c
| Author | SHA1 | Date |
|---|---|---|
|
|
5892921a7c | |
|
|
470efe6956 |
|
|
@ -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>
|
||||||
|
|
@ -76,6 +76,9 @@ export function useAuth<T = User>() {
|
||||||
await $larafetch('/logout', { method: 'post' })
|
await $larafetch('/logout', { method: 'post' })
|
||||||
user.value = null
|
user.value = null
|
||||||
|
|
||||||
|
const csrf_cookie = useCookie('XSRF-TOKEN')
|
||||||
|
csrf_cookie.value = null
|
||||||
|
|
||||||
await router.push('/login')
|
await router.push('/login')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
definePageMeta({ middleware: ['auth'] })
|
||||||
|
const { logout } = useAuth()
|
||||||
|
logout()
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue