Next.js Discord

Discord Forum

Getting user object as null while validating using Next-auth

Unanswered
Santhosh Prabhakaran posted this in #help-forum
Open in Discord
I've created the DB using MongoDB as an separate folder called server and another seperate folder is my next application. I want to authenticate the user from the next app with the MongoDB user data. I'm using Next-auth for this. The "app/api/auth/[...nextauth]/route.js" code looks like,

Here the db is connecting but the user object is coming as null. Any help on this would be appreciated since I'm new to next-auth.

0 Replies