mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 00:51:20 +00:00
19 lines
554 B
TypeScript
19 lines
554 B
TypeScript
|
|
// Used by Better Auth CLI for schema generation.
|
||
|
|
// Run: bunx --bun auth@latest generate --config auth.ts --output src/db/auth-schema.ts
|
||
|
|
import { betterAuth } from "better-auth"
|
||
|
|
import { drizzleAdapter } from "better-auth/adapters/drizzle"
|
||
|
|
import { SQL } from "bun"
|
||
|
|
import { drizzle } from "drizzle-orm/bun-sql"
|
||
|
|
|
||
|
|
const client = new SQL({ url: process.env.DATABASE_URL })
|
||
|
|
const db = drizzle({ client })
|
||
|
|
|
||
|
|
export const auth = betterAuth({
|
||
|
|
database: drizzleAdapter(db, { provider: "pg" }),
|
||
|
|
emailAndPassword: {
|
||
|
|
enabled: true,
|
||
|
|
},
|
||
|
|
})
|
||
|
|
|
||
|
|
export default auth
|