Перейти к содержимому

Master Next Auth V5 With Next JS 14

fsniraj

0:00 / 0:00

Master Next Auth V5 With Next JS 14

5 823 просмотра · 2 года назад
fsniraj
12,5 тыс. подписчиков
5 823 просмотра · 2 года назад
In this video, we'll dive into adding authentication to your Next.js application using NextAuth, the official and recommended approach for Next.js projects. We'll walk through the entire process, from setting up user registration (sign-up) to generating email verification links. Along the way, we'll also cover the database setup using MongoDB and email handling with Mailtrap. Once sign-up is complete, we'll move on to implementing the sign-in process. You'll learn how to create forgotten password links so users can easily reset their passwords if needed. We'll also tackle the challenge of profile image uploads in Next.js—a crucial feature that's often tricky to implement. I'll guide you through the process, including how to update the session after an image upload. Finally, we'll integrate Google OAuth to enable users to sign in with their Google accounts, adding a "Continue with Google" feature to your application. By the end of this video, you'll have a comprehensive understanding of how to implement a full-fledged authentication system in Next.js. Download Resources: https://download.fsniraj.dev/ Need Help: https://www.fsniraj.dev/contact-us Video Content: 00:00:00 Introduction & Project Setup 00:06:10 Basic Authentication Flow 00:26:26 Basic UI & Forms 00:38:41 Sign Up Using Server Action 00:45:23 Database (mongodb) Setup 01:00:40 Validating & Storing New User to DB 01:13:51 Gerring Response From Actions 01:24:08 Hashing Password 01:34:03 Preventing Duplicate Users 01:37:49 useFormStatus Hook 01:41:25 Email Verification Link 01:56:54 Sending Verification Link to Email 02:09:51 Verifying Email Address 02:18:25 Sign In With Credentials 02:43:41 Grouping Routes by Auth Status 02:53:31 Regenerate Email Verification UI 02:56:57 Returning Custom Session 03:07:49 Regenerate Email Verification Link 03:14:34 Update User Info & Session 03:25:43 File Upload & Profile Picture Update 03:51:02 Forget Password Link 04:20:50 Continue With Google Setup 04:41:49 Bonus (Sending Real Emails)