feat(frontend): Use betterAuth implementation from nuxthub-better-auth project

This commit is contained in:
2025-04-20 09:54:16 +02:00
parent 4e7a962a06
commit eec15dd7ef
17 changed files with 209 additions and 66 deletions

View File

@@ -60,13 +60,13 @@ const colors = [
]
const neutrals = ['slate', 'gray', 'zinc', 'neutral', 'stone']
const { data: session } = await useSession(useFetch)
const { user: betterAuthUser, signOut } = await useAuth()
const user = ref({
name: session?.value?.user?.name,
name: betterAuthUser.value?.name,
avatar: {
src: '/_nuxt/public/favicon.ico',
alt: session?.value?.user?.name
alt: betterAuthUser.value?.name
}
})
@@ -115,7 +115,6 @@ const items = computed<DropdownMenuItem[][]>(() => [
type: 'checkbox',
onSelect: (e) => {
e.preventDefault()
appConfig.ui.colors.primary = color
}
}))
@@ -136,7 +135,6 @@ const items = computed<DropdownMenuItem[][]>(() => [
checked: appConfig.ui.colors.neutral === color,
onSelect: (e) => {
e.preventDefault()
appConfig.ui.colors.neutral = color
}
}))
@@ -154,7 +152,6 @@ const items = computed<DropdownMenuItem[][]>(() => [
checked: colorMode.value === 'light',
onSelect(e: Event) {
e.preventDefault()
colorMode.preference = 'light'
}
},
@@ -182,7 +179,6 @@ const items = computed<DropdownMenuItem[][]>(() => [
async onSelect(e: Event) {
e.preventDefault()
signOut()
await navigateTo('/login')
}
}
]