// Schema definition has fields
const user = pgTable("user", {
firstName: text("first_name"),
lastName: text("last_name"),
// ...other fields
});
// Auth config includes them
const auth = betterAuth({
database: drizzleAdapter(db, {
schema: { user } // User table with firstName/lastName
}),
user: {
additionalFields: {
firstName: {
type: "string",
fieldName: "firstName",
},
lastName: {
type: "string",
fieldName: "lastName",
}
}
}
});
// Schema definition has fields
const user = pgTable("user", {
firstName: text("first_name"),
lastName: text("last_name"),
// ...other fields
});
// Auth config includes them
const auth = betterAuth({
database: drizzleAdapter(db, {
schema: { user } // User table with firstName/lastName
}),
user: {
additionalFields: {
firstName: {
type: "string",
fieldName: "firstName",
},
lastName: {
type: "string",
fieldName: "lastName",
}
}
}
});