fix: map custom Prisma model names to Better Auth schema

This commit is contained in:
Lorentz 2026-02-16 12:52:10 +00:00
parent 17ef200f6a
commit 17f6188132

View file

@ -5,6 +5,13 @@ import { db } from './db';
export const auth = betterAuth({ export const auth = betterAuth({
database: prismaAdapter(db, { database: prismaAdapter(db, {
provider: 'postgresql', provider: 'postgresql',
// Map our custom table names to Better Auth models
schema: {
user: 'auth_user',
session: 'auth_session',
account: 'auth_account',
verification: 'auth_verification',
},
}), }),
emailAndPassword: { emailAndPassword: {
enabled: true, enabled: true,