Next.js Discord

Discord Forum

Not being able to get session?.user?.id from user session from next-auth v5 and next.js 14

Unanswered
Stellar Hartaj posted this in #help-forum
Open in Discord
so , I just implemented Next-auth.js v5 in next.js 14 without using "use client" and now i am trying to integrate PostgresSQL , I want to save user OAuth Google data in postgresSQL after signIn ,(BTW I am trying to build Google Docs Clone ) , whenever I login on server Console the data is shown fully as you can see in screenshot , however whenever I try to console.log(session?.user?.id) , it shows Undefined .How can I access Id and get it to save in my PostgreSQL as in Google Docs Clone I also need to access already saved documents using User id and document ID

0 Replies