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
auth.ts
7 Replies
Can you give the starting part of this error message
....database. If you haven't generated the Prisma client
it should be something like "Model ${model} does not exist in the database."
Also can you share your prisma schema?
Argument password
is missing.
This maybe indicates that the password field was not provided when the signUp.email
was calledSure
redacted email and root folder name
I am passing the password field, I can see it logged. Prisma client is present and so is my schema.
I am passing my prisma client in
auth.ts
you are requiring the password in the user schema but it is stored in the account table
https://www.better-auth.com/docs/concepts/database#account
Database | Better Auth
Learn how to use a database with Better Auth.
the user entry is created first then the credential account is linked to the user table
make sure to remove the password field from the user schema in primsa
That was it. Created all the tables as per schema and it worked. Thank you so much.
-----
I had a question though - does better auth facilitate sending a link with token in the email that lets the user authenticate upon sign in? Don't think I saw something specifically about that in the socs except for magic link.
like this plugin?
https://www.better-auth.com/docs/plugins/email-otp
Email OTP | Better Auth
Email OTP plugin for Better Auth.
Yes that is what I was looking for. Trying it out now.
Thanks again.