feat(frontend): Add organization creation, deletion, add better-auth organization plugin

This commit is contained in:
2025-04-06 09:35:15 +02:00
parent 99d3b28381
commit eed4b673c0
11 changed files with 496 additions and 14 deletions

View File

@@ -1,7 +1,18 @@
import { createAuthClient } from 'better-auth/vue'
import { organizationClient } from 'better-auth/client/plugins'
export const authClient = createAuthClient({
baseURL: 'http://localhost:3000'
baseURL: 'http://localhost:3001',
plugins: [organizationClient()]
})
export const { signIn, signOut, signUp, useSession, forgetPassword, resetPassword } = authClient
export const {
signIn,
signOut,
signUp,
useSession,
forgetPassword,
resetPassword,
organization,
useListOrganizations
} = authClient

View File

@@ -0,0 +1,6 @@
import type { auth } from '../server/utils/auth'
import type { authClient } from './auth-client'
export type Session = typeof auth.$Infer.Session
export type ActiveOrganization = typeof authClient.$Infer.ActiveOrganization
export type Invitation = typeof authClient.$Infer.Invitation