24 lines
523 B
TypeScript
24 lines
523 B
TypeScript
import { betterAuth } from "better-auth";
|
|
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
|
import { db } from "./db";
|
|
|
|
export const auth = betterAuth({
|
|
database: drizzleAdapter(db, {
|
|
provider: "pg",
|
|
usePlural: true,
|
|
}),
|
|
secret: process.env.BETTER_AUTH_SECRET!,
|
|
user: {
|
|
deleteUser: {
|
|
enabled: true,
|
|
},
|
|
},
|
|
emailAndPassword: {
|
|
enabled: false,
|
|
},
|
|
appName: "AppCut",
|
|
trustedOrigins: ["http://localhost:3000"],
|
|
});
|
|
|
|
export type Auth = typeof auth;
|