feat(frontend): Use betterAuth implementation from nuxthub-better-auth project
This commit is contained in:
@@ -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')
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user