feat(frontend): Use betterAuth implementation from nuxthub-better-auth project
This commit is contained in:
@@ -69,16 +69,16 @@
|
||||
<p class="text-xs text-gray-500">{{ member.role }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="session && canRemove({ role: 'owner' }, member)">
|
||||
<div v-if="user && canRemove({ role: 'owner' }, member)">
|
||||
<UButton size="xs" color="error" @click="organization.removeMember({ memberIdOrEmail: member.id })">
|
||||
{{ member.user.id === session.id ? 'Leave' : 'Remove' }}
|
||||
{{ member.user.id === user.id ? 'Leave' : 'Remove' }}
|
||||
</UButton>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!activeOrganization?.id" class="flex items-center gap-2">
|
||||
<UAvatar :src="session?.image ?? undefined" />
|
||||
<UAvatar :src="user?.image ?? undefined" />
|
||||
<div>
|
||||
<p class="text-sm">{{ session?.name }}</p>
|
||||
<p class="text-sm">{{ user?.name }}</p>
|
||||
<p class="text-xs text-gray-500">Owner</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -141,7 +141,8 @@ import { useClipboard } from '@vueuse/core'
|
||||
const { copy, copied } = useClipboard()
|
||||
const toast = useToast()
|
||||
|
||||
const organizations = computed(() => useListOrganizations().value.data || [])
|
||||
const { organization, client } = useAuth()
|
||||
const organizations = computed(() => client.useListOrganizations.value?.data || [])
|
||||
const { deleteOrganization: betterAuthDeleteOrganization, activeOrganization, selectedOrgId } = useBetterAuth()
|
||||
|
||||
const selectItems = computed(() => organizations.value.map((org) => ({ label: org.name, value: org.id })))
|
||||
@@ -151,8 +152,7 @@ watch(selectedOrgId, async (newId) => {
|
||||
activeOrganization.value = data
|
||||
})
|
||||
|
||||
const { data: sessionData } = useSession().value
|
||||
const session = computed(() => sessionData?.user)
|
||||
const { user } = await useAuth()
|
||||
|
||||
const isRevoking = ref<string[]>([])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user