deepstretch
BABetter Auth
•Created by deepstretch on 3/10/2025 in #help
Facing issue with sign up
I'm working on a nextjs app with prisma, database on hoted supabase. I'm trying to do a simple sign up flow, but am getting this error:
Console error:
My schema generation is done using prisma, and my table is created.
my
....database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);
7865 }
→ 7866 const result = await db[getModelName(model)].create({
data: {
id: "xkYF7mgMe4Jn8hGImGPoNTnw35A2LcIU",
name: "",
email: "[email protected]",
emailVerified: false,
createdAt: new Date("2025-03-10T07:50:35.758Z"),
updatedAt: new Date("2025-03-10T07:50:35.758Z"),
+ password: String
},
select: undefined
})
Argument `password` is missing.] {
clientVersion: '6.4.1'
}
....database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);
7865 }
→ 7866 const result = await db[getModelName(model)].create({
data: {
id: "xkYF7mgMe4Jn8hGImGPoNTnw35A2LcIU",
name: "",
email: "[email protected]",
emailVerified: false,
createdAt: new Date("2025-03-10T07:50:35.758Z"),
updatedAt: new Date("2025-03-10T07:50:35.758Z"),
+ password: String
},
select: undefined
})
Argument `password` is missing.] {
clientVersion: '6.4.1'
}
{message: 'Failed to create user', details: {…}, code: 'FAILED_TO_CREATE_USER', status: 422, statusText: 'UNPROCESSABLE_ENTITY'}
code
:
"FAILED_TO_CREATE_USER"
details
:
{name: 'PrismaClientValidationError', clientVersion: '6.4.1'}
message
:
"Failed to create user"
status
:
422
statusText
:
"UNPROCESSABLE_ENTITY"
[[Prototype]]
:
Object
{message: 'Failed to create user', details: {…}, code: 'FAILED_TO_CREATE_USER', status: 422, statusText: 'UNPROCESSABLE_ENTITY'}
code
:
"FAILED_TO_CREATE_USER"
details
:
{name: 'PrismaClientValidationError', clientVersion: '6.4.1'}
message
:
"Failed to create user"
status
:
422
statusText
:
"UNPROCESSABLE_ENTITY"
[[Prototype]]
:
Object
auth.ts
import { betterAuth } from "better-auth";
import { prismaAdapter } from "better-auth/adapters/prisma";
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "postgresql",
}),
emailAndPassword: {
enabled: true,
autoSignIn: true,
},
});
import { betterAuth } from "better-auth";
import { prismaAdapter } from "better-auth/adapters/prisma";
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "postgresql",
}),
emailAndPassword: {
enabled: true,
autoSignIn: true,
},
});
15 replies