feat(frontend): Use betterAuth implementation from nuxthub-better-auth project

This commit is contained in:
2025-04-20 09:54:16 +02:00
parent 4e7a962a06
commit eec15dd7ef
17 changed files with 209 additions and 66 deletions

View File

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

View File

@@ -1,10 +1,3 @@
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
// Types can be found here: https://github.com/better-auth/better-auth/blob/3f574ec70bb15c155a78673d42c5e25f7376ced3/packages/better-auth/src/plugins/organization/routes/crud-invites.ts#L531
export type CustomInvitation = {
organizationName: string