Replies: 1 comment
-
Hi, did you manage to figure this out? I also don't know what the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Your question
Is next-auth supposed to create an entry in MongoDB automatically after a user logs in? If so, how do I set it up?
What are you trying to do
I am trying to create a user in the
users
collection in MongoDB after the user logs in with Google for the first time. I have tried connecting my database to the example project but my MongoDB atlas collection was still empty after the user logs in.I have been stuck on this for days and couldn't figure out how to do it properly. Right now, I am manually creating the user in the
signIn
event but the problem is that the user being created will have a different _id from the user.id in thesession
callback.Feedback
I think I should be setting up adapters for MongoDB but I am not sure. I am new to working with databases and authentication so I think having an example specific to MongoDB (just like the Prisma example) would be nice. Thank you so much!
Beta Was this translation helpful? Give feedback.
All reactions