You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
don't know the exact reason I faced the same issue.
the json payload sent to one of the backend service from route handler was empty.
I did headers: { 'content-type': 'application/json', 'content-length': JSON.stringify(values).length + '' },
and it worked for me too.
It's definitely has to do something related to nextjs's wrap around the fetch (to handle cache) which is globally available.
But thanks for your workaround here.
I'm using nextjs 13 with new app router and next-auth. My authorize method in CredentialsProvider looks like this:
Here is the body of the loginUser method
And server gets empty request payload because header
content-length
is empty ("").When I add it manually it suddenly works.
headers: { 'content-type': 'application/json', 'content-length': JSON.stringify(values).length + '' },
Does someone knows why that is happening?
The text was updated successfully, but these errors were encountered: