feat(frontend): Update better-auth, add orga slug check, add PDF preview, fix invitation
This commit is contained in:
@@ -89,30 +89,34 @@
|
||||
<div class="flex-1">
|
||||
<p class="font-medium mb-2">Invites</p>
|
||||
<div class="space-y-2">
|
||||
<div
|
||||
v-for="inv in activeOrganization?.invitations.filter((i: Invitation) => i.status === 'pending')"
|
||||
:key="inv.id"
|
||||
class="flex justify-between items-center"
|
||||
>
|
||||
<div>
|
||||
<p class="text-sm">{{ inv.email }}</p>
|
||||
<p class="text-xs text-gray-500">{{ inv.role }}</p>
|
||||
<template v-if="activeOrganization?.invitations">
|
||||
<div
|
||||
v-for="invitation in activeOrganization?.invitations.filter(
|
||||
(i: Invitation) => i.status === 'pending'
|
||||
)"
|
||||
:key="invitation.id"
|
||||
class="flex justify-between items-center"
|
||||
>
|
||||
<div>
|
||||
<p class="text-sm">{{ invitation.email }}</p>
|
||||
<p class="text-xs text-gray-500">{{ invitation.role }}</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<UButton
|
||||
size="xs"
|
||||
color="error"
|
||||
:loading="isRevoking.includes(invitation.id)"
|
||||
@click="() => handleRevokeInvitation(invitation.id)"
|
||||
>
|
||||
Revoke
|
||||
</UButton>
|
||||
<UButton icon="i-lucide-copy" size="xs" @click="copy(getInviteLink(invitation.id))">
|
||||
{{ copied ? 'Copied!' : 'Copy' }}
|
||||
</UButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<UButton
|
||||
size="xs"
|
||||
color="error"
|
||||
:loading="isRevoking.includes(inv.id)"
|
||||
@click="() => handleRevokeInvitation(inv.id)"
|
||||
>
|
||||
Revoke
|
||||
</UButton>
|
||||
<UButton icon="i-lucide-copy" size="xs" @click="copy(getInviteLink(inv.id))">
|
||||
{{ copied ? 'Copied!' : 'Copy' }}
|
||||
</UButton>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="!activeOrganization?.invitations.length" class="text-sm text-gray-500">
|
||||
</template>
|
||||
<p v-if="!activeOrganization?.invitations?.length" class="text-sm text-gray-500">
|
||||
No active invitations
|
||||
</p>
|
||||
<p v-if="!activeOrganization?.id" class="text-xs text-gray-500">
|
||||
@@ -137,6 +141,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useClipboard } from '@vueuse/core'
|
||||
import type { Invitation } from 'better-auth/plugins'
|
||||
|
||||
const { copy, copied } = useClipboard()
|
||||
const toast = useToast()
|
||||
@@ -173,7 +178,7 @@ async function handleRevokeInvitation(invitationId: string) {
|
||||
isRevoking.value = isRevoking.value.filter((id) => id !== invitationId)
|
||||
if (activeOrganization.value) {
|
||||
activeOrganization.value.invitations = activeOrganization.value.invitations.filter(
|
||||
(inv) => inv.id !== invitationId
|
||||
(invitation: Invitation) => invitation.id !== invitationId
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user