Next-Auth credentials login troubles debugging

26 Views Asked by At

How can I debug issues when logging in using next-auth. I use my custom form. After clicking sign in button we send credentials to ouraddress/api/auth/callback/credentials and Ii network tab I can see json response

{
    "url": "http://localhost:3000/api/auth/error?error=Cannot%20read%20properties%20of%20undefined%20(reading%20'data')"
}

I understand that I'm referencing undefined.data somewhere in my code. But I have no clue where for now and the main thing I don't know how the chain of logic that happens after clicking log in. Also As I understand server code generated by next-auth sent this response to browser. Just and object with "url" property. But why? ^).
I have made my server with NestJS. So that might be even ab error there. On the other hand I can't see it in api's server logs so it must be my nextjs frontend app issue

0

There are 0 best solutions below