Issue with sign up using express
Hi,
I have been running in to an issue where my express server returns 422 Unprocessable Entity any time the client sends a sign up request. I have included my prisma schema, better auth config and my index.ts file (I have pretty much copied exactly whats on the better auth docs).
Looking at the incoming requests on the express server, I can see the sign up requests come through however I noticed that the request body was undefined. Looking at the actual request through the network I can see that body is included in the post request. I have no issues adding data to the db manually through psql. Any ideas on what is causing this issue?
auth.ts
index.ts
4 Replies
prima.schema
I followed the core schema provided here:
https://www.better-auth.com/docs/concepts/database#account
can you please add body parser right after the initialization
@KiNFiSH I tried this, it allows for the request to finally go through but then the client side gets stuck on pending. Looking at the docs it says
Because of this I don't think this is the correct solution
link to the docs where this is said:
https://www.better-auth.com/docs/integrations/express
I mean the better auth route initialization
You can put it right below it
did you catch the body on the middleware ?
and can u show me the serevr log on doing so