The Ultimate Guide to Next Auth - Everything You Need

preview_player
Показать описание

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!

Timestamps
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
Рекомендации по теме
Комментарии
Автор

WOW THANK YOU this really really helped it was super clear and easy to follow

erickugel
Автор

Maaaan this literally saved my life. I was struggling to get both credentials with next auth working, but it does now. THANK YOU SOOOO MUCH

adammo
Автор

One of the best tutorials I have seen on YouTube, you explained everything perfectly and in detail, looking forward to your next videos!

joex
Автор

Just found your channel and subscribed, i like how your tutorials are long and in depth about concepts to understand instead of just project tutorials, and i dont think 10 or 15 minute short videos can do the same.

eshw
Автор

I am telling you this seriously. I have watched 20+ videos on YouTube about the same. All the time things didn`t worked out. But today i completed your video and trust me on this, your tutorial is the best tutorial in the whole world. Just wanted to say you thank You

codewithsam
Автор

Hey Brett, I wanted to thank you for the very comprehensive video.
Authentication is always a messy topic, and it's very appreciable how you explained not only credentials but also social login. Thanks again

hamzahahmad
Автор

You're an amazing teacher, and this is premium content. The way you explain every step makes it feel like a one on one class. Thank you!

gbani_d
Автор

You don't have no idea how much i need this, thank you. Clear and concise <3

briandacallos
Автор

Wow. Great video. I had to go through it twice to get everything right (I used typescript)

phil
Автор

the most comprehensive NextAuth tutorial, well done Brett!

rafin_rahman
Автор

I did this hundred of times, but this is the first time I actually understand how it works. Thanks! you're a great teacher.

pablopenia
Автор

Simply FABULOUS !!! THANK YOU SO VERY MUCH !!! I followed along. Perfect. You showed every nitty-gritty, were not too fast, not too slow, did not switch screens/windows suddenly (which confuses us, the beginners), were describing what you were doing, where you were doing, and why you were doing. Once more, THANK YOU !!!

shumit
Автор

Wow I just happily spend 5 hours watching and rewatching this video and I learned a lot. I don't know why I enjoyed some much. Thank Brett, you just earn a new loyal suscriber❤

carafachera
Автор

you just saved my final year project man!!!! Thank You 1000 times

harshwardhanmore
Автор

Your channel deserves more attention!
10/10 explanation!

hadirahal
Автор

Very useful. Appreciated showing both server and client auth

aubreyocallaghan
Автор

Thank you for the video!
When registering, you need to block the form submit button after clicking, since you can spam the button and there will be many identical users in the database, you also need to add a check on the server when creating.
Also, do not add your .env file to the repository. Now you have data that other users can use for authorization, be careful

ahasiakopian
Автор

Curious why you didn't use the session model? As is suggested in the Next Auth docs on the Prisma adapter.

rod
Автор

The best tutorial I found so far about Next 13 authentication. Everything was explained clear. Thank you so much ...🙏😍😍

sahaneakanayaka
Автор

My search is over. Thank you Brett, great session

isaachatilima