streaming, markdown, model selecting, and lots more
This commit is contained in:
+25
-12
@@ -1,19 +1,32 @@
|
||||
import { betterAuth } from "better-auth/minimal";
|
||||
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
||||
import * as schema from "~~/db/schema";
|
||||
import { useDrizzle } from "~~/server/utils/drizzle";
|
||||
import { triplitAdapter } from '@daveyplate/better-auth-triplit';
|
||||
import { HttpClient } from '@triplit/client';
|
||||
import { betterAuth } from 'better-auth/minimal';
|
||||
import { schema } from '../triplit/schema';
|
||||
|
||||
const httpClient = new HttpClient({
|
||||
schema,
|
||||
serverUrl: process.env.NUXT_PUBLIC_TRIPLIT_URL,
|
||||
token: process.env.TRIPLIT_SERVICE_TOKEN,
|
||||
});
|
||||
|
||||
export const auth = betterAuth({
|
||||
database: drizzleAdapter(useDrizzle(), {
|
||||
provider: "pg",
|
||||
schema: {
|
||||
...schema
|
||||
}
|
||||
database: triplitAdapter({
|
||||
httpClient,
|
||||
secretKey: process.env.BETTER_AUTH_SECRET,
|
||||
}),
|
||||
|
||||
session: {
|
||||
cookieCache: {
|
||||
enabled: true,
|
||||
maxAge: 5 * 60,
|
||||
},
|
||||
},
|
||||
|
||||
trustedOrigins: [process.env.NUXT_PUBLIC_URL ?? 'http://localhost:3000'],
|
||||
|
||||
emailAndPassword: {
|
||||
// if DISABLE_LOCAL_AUTH is set to "1" or "true" then local auth is disabled
|
||||
enabled: process.env.DISABLE_LOCAL_AUTH?.toLowerCase() !== "true" && process.env.DISABLE_LOCAL_AUTH !== "1",
|
||||
disableSignUp: process.env.DISABLE_SIGNUP?.toLowerCase() === "true" || process.env.DISABLE_SIGNUP === "1",
|
||||
enabled: process.env.DISABLE_LOCAL_AUTH?.toLowerCase() !== 'true' && process.env.DISABLE_LOCAL_AUTH !== '1',
|
||||
disableSignUp: process.env.DISABLE_SIGNUP?.toLowerCase() === 'true' || process.env.DISABLE_SIGNUP === '1',
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user