feat: Implement initial with admin and mobile clients, authentication, data models, and lead generation scripts.

This commit is contained in:
2026-02-19 16:18:34 +01:00
parent c53a71a5f9
commit 5e2d5fb3ae
32 changed files with 2283 additions and 420 deletions

View File

@@ -1,6 +1,7 @@
import { createAuthClient } from 'better-auth/react'
import { magicLinkClient } from 'better-auth/client/plugins'
import Constants from 'expo-constants'
import AsyncStorage from '@react-native-async-storage/async-storage'
const apiUrl =
Constants.expoConfig?.extra?.apiUrl ??
@@ -10,4 +11,15 @@ const apiUrl =
export const authClient = createAuthClient({
baseURL: apiUrl,
plugins: [magicLinkClient()],
fetchOptions: {
customFetchImpl: async (url, options) => {
const token = await AsyncStorage.getItem('better-auth-session')
const headers = new Headers((options?.headers as HeadersInit) ?? {})
headers.set('origin', apiUrl)
if (token) {
headers.set('cookie', `better-auth.session_token=${token}`)
}
return fetch(url, { ...options, headers })
},
},
})