The Ultimate Guide to Next Auth – Everything You Need

Github Source Code:

Private 1 on 1 Help 👇

Join my FREE Discord to talk and network about web development! 👇

In this video, I will go over Next Auth and how to set up an actual working login and register page that authenticates a registered user or a user who uses the Google or Github Provider.

I will show you how you can store all the users in a MongoDB database by connecting our project to Prisma. We will also hash the passwords with bcrypt.

We will be using toast notifications to alert users client side if an error occurs during the sign in or register process.

After watching this tutorial you will have a fully functional working authentication system for your application.

Join my FREE Discord to talk and network about web development! 👇

So sit back and get ready for a lot of information.

Like and subscribe as well!

0:00 Intro
1:16 Set Up Environment
6:07 Connect Prisma & MongoDB
11:12 Create Prisma Schemas
13:08 Prisma Client
15:05 Set up NextAuth Catch All Route
24:08 Test Credentials Provider with Prebuilt Sign-In Page
26:19 Retrieve Session Data
34:25 Create Register Page Client Side
41:13 Create Register API Endpoint POST Request
46:51 Using Axios to Connect frontend register functionality
48:34 Test out Register Functionality
51:40 Create Login Page Client Side
54:37 Create Login Authentication Backend Functionality in NextAuth
1:01:32 Use signIn Function from NextAuth for Login Page
1:04:14 React Hot Toast Notifications
1:15:50 GitHub Provider
1:21:50 Google Provider
1:28:15 Protect Pages with Authentication
1:35:51 Outro