glowing-fiesta-original/shared/utils/auth.ts
Liviu Burcusel 6d3cdb560d
All checks were successful
Production Build and Deploy / Build (push) Successful in 1m7s
Production Build and Deploy / Deploy (push) Successful in 29s
[Closes #8] Added authentication
2026-01-07 11:19:52 +01:00

18 lines
390 B
TypeScript

import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { v7 as uuidv7 } from "uuid";
import db from "./db/index";
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
}),
advanced: {
database: {
generateId: () => uuidv7(),
},
},
emailAndPassword: {
enabled: true,
},
});