Invalid body parameters
Hello ! I have a very strange problem, i'am switching my backend from NextJS to AdonisJS, I'm setting up better-auth on AdonisJS (NodeJS Framework) but i have a problem when i call this endpoint : POST / http://localhost:3333/api/auth/sign-in/email / { "email":"[email protected]","password":"Test"}
And (maybe) better-auth return this :
{
"code": "VALIDATION_ERROR",
"message": "Invalid body parameters"
}
Front -> NextJS -> signIn.email
Backend -> AdonisJS
---
I haven't found any similar problems on the discord/github
4 Replies
you need to provide a content-type header set to
application/json
I make requests via Postman, the application/json content type is already set as standard. In fact on the nextjs backend it works fine but on the Adonis backend I get this error, maybe the middleware ?
if you have a middleware that's parsing the body that could be another issue
It was the middleware, it works now, I'll put it here if anyone has any problems with AdonisJS.