Learn how to implementation forget password and reset password functionality using Next-Auth in Next.js 14. We will show you how to generate tokens, store token in user model in mongodb, send email to user with url to reset password, verify token validity and expiry and finally reset password. 
So, I will create 2 frontend components for forget password form reset password form. I will create 3 apis to generate and send email to user using sendgrid, api for verifying token which is store in user's model in database and finally reset password api to generate hashed password and update it in database.

01:30 Next.js 14 Tutorials
03:45 Overview of forget password using next-auth in next.js 14
08:50 Update next.js 13 to next.js 14
09:55 Create forget password component for next-auth
15:30 Api route for forget password
21:40 Update User mongoose model
27:30 Configure sendgrid for sending email
37:10 Create reset password component
43:40 Create api to verify token
47:30 Use verify token api on client side
52:00 Create api to reset password
59:30 Testing

First Part (Next-Auth Login Register in next.js 14 with MongoDB):
https://morioh.com/a/264400764d74/next-auth-login-or-register-in-nextjs-14-with-mongodb 

First part source code (Give it a Star ⭐️ )
https://github.com/umairjameel321/next-auth-mongodb 

Subscribe: https://www.youtube.com/@ProgrammingwithUmair321/featured 

#nextjs14  #nextauth  #javascript 

Forget Password & Reset Password Functionality using Next-Auth in Next.js 14
1.60 GEEK