refactor: add fields

This commit is contained in:
Mauricio Siu
2025-02-13 01:42:58 -06:00
parent 74ee024cf9
commit 7c0d223e17
12 changed files with 10726 additions and 2 deletions

View File

@@ -5,6 +5,9 @@ import { admin, createAuthMiddleware, organization } from "better-auth/plugins";
import { eq } from "drizzle-orm";
import { db } from "../db";
import * as schema from "../db/schema";
import { Scrypt } from "lucia";
const scrypt = new Scrypt();
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
@@ -12,6 +15,10 @@ export const auth = betterAuth({
}),
emailAndPassword: {
enabled: true,
password: {
hash: scrypt.hash,
verify: scrypt.verify,
},
},
hooks: {
after: createAuthMiddleware(async (ctx) => {