Next.js Discord

Discord Forum

NextAuth User Login Using Email/Password and MongoDb

Answered
German yellowjacket posted this in #help-forum
Open in Discord
German yellowjacketOP
I've tried looking at multiple videos/articles but I can't seem to find a good one on how to implement user login/registration and session management while storing user data to mongodb. A lot of them just talk about implementing github/google auth. If anyone has a link to a good source that would be greatly appreciated.
Answered by German yellowjacket
Didn't get notified about your reply so I'm just seeing this. Appreciate your help but I did end up find a video about this online. I'll link it below in case anyone else tries something similar.
https://www.youtube.com/watch?v=PEMfsqZ2-As
View full answer

3 Replies

hmmm, i have source using this but use prisma to connect mongodb, would you like to try it?
for example, while login success, you return user data in authoritze function
and set this data to token.user and session.user in callback function
in this code, i have handle when update user data, data in session and token will update
@Tiesen for example, while login success, you return user data in authoritze function and set this data to token.user and session.user in callback function in this code, i have handle when update user data, data in session and token will update
German yellowjacketOP
Didn't get notified about your reply so I'm just seeing this. Appreciate your help but I did end up find a video about this online. I'll link it below in case anyone else tries something similar.
https://www.youtube.com/watch?v=PEMfsqZ2-As
Answer