From 4d1280749f03d145ae2592f1340dad089454e469 Mon Sep 17 00:00:00 2001 From: Denis Lugowski Date: Sun, 27 Jul 2025 09:03:11 +0200 Subject: [PATCH] feat(frontend): Update better-auth, add orga slug check, add PDF preview, fix invitation --- legalconsenthub/composables/useBetterAuth.ts | 6 + legalconsenthub/package.json | 5 +- legalconsenthub/pages/administration.vue | 53 ++++---- .../application-forms/[id]/[sectionIndex].vue | 4 +- legalconsenthub/pnpm-lock.yaml | 124 +++++++++++------- legalconsenthub/server/utils/auth.ts | 1 + 6 files changed, 116 insertions(+), 77 deletions(-) diff --git a/legalconsenthub/composables/useBetterAuth.ts b/legalconsenthub/composables/useBetterAuth.ts index 2e36229..cad0616 100644 --- a/legalconsenthub/composables/useBetterAuth.ts +++ b/legalconsenthub/composables/useBetterAuth.ts @@ -6,6 +6,12 @@ export function useBetterAuth() { const { organization } = useAuth() async function createOrganization(name: string, slug: string, logo?: string) { + const slugCheck = await organization.checkSlug({ slug }) + if (!slugCheck.data.available) { + toast.add({ title: 'Slug bereits vergeben', description: 'Bitte wählen Sie einen anderen Slug', color: 'error' }) + return Promise.reject() + } + await organization.create( { name, slug, logo }, { diff --git a/legalconsenthub/package.json b/legalconsenthub/package.json index 1df3fd7..0ee077a 100644 --- a/legalconsenthub/package.json +++ b/legalconsenthub/package.json @@ -7,12 +7,13 @@ "dev": "nuxt dev --port 3001 --host", "generate": "nuxt generate", "preview": "nuxt preview", - "postinstall": "nuxt prepare && pnpm run fix:bettersqlite && pnpm run api:generate", + "postinstall": "nuxt prepare && pnpm run fix:bettersqlite && pnpm run api:generate && pnpm run api:middleware:generate", "format": "prettier . --write", "type-check": "nuxi typecheck", "lint": "eslint .", "lint:fix": "eslint . --fix", "api:generate": "openapi-generator-cli generate -i ../legalconsenthub-backend/api/legalconsenthub.yml -g typescript-fetch -o .api-client", + "api:middleware:generate": "openapi-generator-cli generate -i ../legalconsenthub-middleware/api/legalconsenthub-middleware.yml -g typescript-fetch -o .api-client-middleware", "fix:bettersqlite": "cd node_modules/better-sqlite3 && pnpm dlx node-gyp rebuild && cd ../..", "generate:betterauth": "pnpm dlx @better-auth/cli generate --config server/utils/auth.ts", "migrate:betterauth": "pnpm dlx @better-auth/cli migrate --config server/utils/auth.ts" @@ -20,7 +21,7 @@ "dependencies": { "@nuxt/ui-pro": "3.1.1", "@pinia/nuxt": "0.10.1", - "better-auth": "1.1.16", + "better-auth": "1.3.4", "better-sqlite3": "11.8.1", "nuxt": "3.16.1", "pinia": "3.0.1", diff --git a/legalconsenthub/pages/administration.vue b/legalconsenthub/pages/administration.vue index 8510f3c..caf45ea 100644 --- a/legalconsenthub/pages/administration.vue +++ b/legalconsenthub/pages/administration.vue @@ -89,30 +89,34 @@

Invites

-
-
-

{{ inv.email }}

-

{{ inv.role }}

+ +

No active invitations

@@ -137,6 +141,7 @@