Better-Auth Nextjs SignUp Issue
Hey there,
I am fairly new to convex. I built a small nextjs app with it and am currently trying to get some basic auth working with the better-auth package.
After going through the setup guide at https://convex-better-auth.netlify.app/ I am facing the following issue:
Every time I try to invoke signUp from the client, using this data:
await authClient.signUp.email(
{
name: "TestUser",
email: "test@example.com",
password: "Password123!",
},
I get the following error:
{"code":"INVALID_EMAIL","message":"Invalid email","status":400,"statusText":"Bad Request"}The troubleshooting I did: 1. I verified that the nextjs better-auth route handler gets the correct data 2. Tried setting up sign in via GitHub. I got more or less the same error. It seems as if better-auth is not receiving the request body. 3. Checked out and set up the official example repo. Got the same error. Btw, I am using the cloud development mode. Does anyone recognize this error? Did I miss something during the setup?
Convex + Better Auth
Typesafe, secure auth for Convex apps with Better Auth
5 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
That error case is really straightforward - are you sending those values static or in variables? Any chance the email isn't actually that value?
Error case here: https://github.com/better-auth/better-auth/blob/b27221b3561478ae98ed5955fde51dfcf59d4a21/packages/better-auth/src/api/routes/sign-up.ts#L157-L172
In my case, I'm getting a 404

Can you open a new support thread with details, what you're seeing is a different issue
Or just drop a comment in #better-auth and thread the details if lengthy
fixed: it turned out that
- I can't test auth locally since I was using cloud dev, I had to deploy my app.
- I added
CONVEX_SITE_URL
which was not automatically added to the .env.local
when convex was initialized.