The Ultimate Guide to Next Auth - Everything You Need

  Рет қаралды 56,544

Brett Westwood - Software Engineer

Brett Westwood - Software Engineer

Күн бұрын

Github Source Code: github.com/bwestwood11/next-a...
Private 1 on 1 Help 👇
calendly.com/dabrettwestwood/...
Join my FREE Discord to talk and network about web development! 👇
/ discord
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! 👇
/ discord
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

Пікірлер: 263
@CaseStudyQB
@CaseStudyQB 10 ай бұрын
Great video. Great job explaining each step and also showing how the network side of things looks in the browser console/tools. Thanks so much! I just subscribed!
@joe25x
@joe25x Жыл бұрын
One of the best tutorials I have seen on KZfaq, you explained everything perfectly and in detail, looking forward to your next videos!
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you so much for the kind words!
@briandacallos4234
@briandacallos4234 10 ай бұрын
You don't have no idea how much i need this, thank you. Clear and concise
@brettwestwooddeveloper
@brettwestwooddeveloper 10 ай бұрын
No problem, glad I could help you!
@shumit
@shumit Жыл бұрын
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 !!!
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you so much for the kind words and tuning in!
@endure_elevate
@endure_elevate 10 ай бұрын
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!
@brettwestwooddeveloper
@brettwestwooddeveloper 10 ай бұрын
Thank you so much!
@hadirahal5403
@hadirahal5403 Жыл бұрын
Your channel deserves more attention! 10/10 explanation!
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you!
@hamzahahmad1670
@hamzahahmad1670 10 ай бұрын
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
@brettwestwooddeveloper
@brettwestwooddeveloper 10 ай бұрын
Thank you so much for the kind comment!
@eshw23
@eshw23 Жыл бұрын
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.
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Welcome aboard!
@carafachera4781
@carafachera4781 Жыл бұрын
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❤
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you so much! I am glad you learned a lot!
@joshuaekeh3775
@joshuaekeh3775 2 ай бұрын
Thanks Brett. Your tutorial is quite easy to follow. You've made very simple.
@adrianhansa7018
@adrianhansa7018 11 ай бұрын
Great tutorial, Brett! I am glad I found your channel. Thanks!
@brettwestwooddeveloper
@brettwestwooddeveloper 11 ай бұрын
Awesome, thank you!
@sahaneakanayaka3394
@sahaneakanayaka3394 Жыл бұрын
The best tutorial I found so far about Next 13 authentication. Everything was explained clear. Thank you so much ...🙏😍😍
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you! You are welcome!
@rafinrahman541
@rafinrahman541 6 ай бұрын
the most comprehensive NextAuth tutorial, well done Brett!
@brettwestwooddeveloper
@brettwestwooddeveloper 5 күн бұрын
Thank you so much!
@erickugel1376
@erickugel1376 11 ай бұрын
WOW THANK YOU this really really helped it was super clear and easy to follow
@brettwestwooddeveloper
@brettwestwooddeveloper 11 ай бұрын
Thank you so much! I am glad you were able to follow my teachings easily! Thanks for tuning in and the donation!
@waqaskhandev
@waqaskhandev 11 ай бұрын
Really Awesome walk through for the Next Auth. Learned alot. Thanks
@brettwestwooddeveloper
@brettwestwooddeveloper 11 ай бұрын
No problem! Thanks for tuning in!
@semajroyam3725
@semajroyam3725 Жыл бұрын
this is what I've been looking for after the update of nextjs, now i can implement this to my capstone project, thank you for this tutorial!
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Glad I can help!
@harshwardhanmore5877
@harshwardhanmore5877 10 ай бұрын
you just saved my final year project man!!!! Thank You 1000 times
@brettwestwooddeveloper
@brettwestwooddeveloper 10 ай бұрын
No problem! Glad I could help you out!
@BBocho
@BBocho Жыл бұрын
Thank you very much, there are very few tutorials like this one implementing auth with the App Router, and it works perfectly fine!
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you! Glad I can help!
@aubreyocallaghan4539
@aubreyocallaghan4539 Ай бұрын
Very useful. Appreciated showing both server and client auth
@brettwestwooddeveloper
@brettwestwooddeveloper Ай бұрын
No problem!
@isaachatilima
@isaachatilima Жыл бұрын
My search is over. Thank you Brett, great session
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you!
@pablopenia
@pablopenia 10 ай бұрын
I did this hundred of times, but this is the first time I actually understand how it works. Thanks! you're a great teacher.
@brettwestwooddeveloper
@brettwestwooddeveloper 10 ай бұрын
Awesome! Thank you! and no problem!
@diamondpro2093
@diamondpro2093 11 ай бұрын
Hey, love the videos. They are really helpful and concise. I was wondering if you could possibly make a video on what changes would have to be made to the application when its being pushed into production (i.e. changing specific environment variables, etc)
@codewithsam7300
@codewithsam7300 Жыл бұрын
I am telling you this seriously. I have watched 20+ videos on KZfaq 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 friend............
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you so much! Glad I could help you out
@Leesdjo
@Leesdjo Ай бұрын
Very detailed video. Thank you so much.
@mahmoua07
@mahmoua07 11 ай бұрын
This is a great explanation of next-auth , thank you brother.
@brettwestwooddeveloper
@brettwestwooddeveloper 11 ай бұрын
You are welcome!
@phil5293
@phil5293 6 ай бұрын
Wow. Great video. I had to go through it twice to get everything right (I used typescript)
@superurgmail
@superurgmail Жыл бұрын
This video is a goldmine! Subbed - you got a new follower. :)
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you!
@raymondmichael4987
@raymondmichael4987 11 ай бұрын
Was scratching my head for this, using both credentials and social medias. Dude you just killed it, watched from zero to last seconds. Time to fight with TS into it 😊 Thanks buddy, thanks a lot ❤ Greetings from Tanzania 🇹🇿
@brettwestwooddeveloper
@brettwestwooddeveloper 11 ай бұрын
No problem! Thanks for tuning in!
@chriseski
@chriseski Жыл бұрын
Like and subscription earned as deserved! Thank you Brett, awesome tutorial!
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you for the sub!
@KkrDs97
@KkrDs97 Жыл бұрын
This is Exactly what i am looking for and great explanation from you, Thank you.
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
No problem! Glad I could help!
@mbaochachigozie1785
@mbaochachigozie1785 Жыл бұрын
By far the best nextAuth tut
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you!
@TharuxYT
@TharuxYT Жыл бұрын
one of the best tutorials I've seen
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you so much!
@mayukhhazari7820
@mayukhhazari7820 10 ай бұрын
Incredible brother 🙌🙌
@brettwestwooddeveloper
@brettwestwooddeveloper 10 ай бұрын
Thank you!
@Shubham-yc6nz
@Shubham-yc6nz Жыл бұрын
Best video on Internet. The latest greatest. I was bit confused about implementation using app/ directory thanks!!!
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you so much for the compliment!
@kathirmldata7411
@kathirmldata7411 Жыл бұрын
crystal clear explanation. easily understanding even for non English speaking country. thanks man. more love from india
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you! I am glad I can help! Thanks for the support
@sguitas
@sguitas Жыл бұрын
This helped me a lot, thanks. Very clear explanation
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Glad I could help!
@ahasiakopian9696
@ahasiakopian9696 11 ай бұрын
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
@codePerfect
@codePerfect 11 ай бұрын
Loved the tutorial
@brettwestwooddeveloper
@brettwestwooddeveloper 11 ай бұрын
Thank you!
@henrymunoz2035
@henrymunoz2035 11 ай бұрын
Love it great work, thank you so much
@brettwestwooddeveloper
@brettwestwooddeveloper 11 ай бұрын
You are welcome! Thanks for tuning in!
@jamesnelson174
@jamesnelson174 Жыл бұрын
Honestly, this guy is dope. I love this tutorial. ❤❤
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you!
@devsspace1918
@devsspace1918 Жыл бұрын
Thank you for sharing this insightful video.
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
No Problem!
@leviathanxid
@leviathanxid 9 ай бұрын
Thankyou so much sir ,this video is really helped me
@brettwestwooddeveloper
@brettwestwooddeveloper 9 ай бұрын
No problem! Thank you for watching my video! Don't forget to hit that subscribe!
@movocode
@movocode 6 ай бұрын
Thank you for the tutorial.
@brettwestwooddeveloper
@brettwestwooddeveloper 6 ай бұрын
You are welcome!
@chris-zlrr
@chris-zlrr 9 ай бұрын
great content 👌🏼
@AlfredLotsu
@AlfredLotsu Жыл бұрын
this is so sick bro thank you
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
No problem!
@TBDfilesLalit_kalyan
@TBDfilesLalit_kalyan 9 ай бұрын
thankyou so much for this tutorial ......kaap doing
@tworzymy_historie
@tworzymy_historie 5 ай бұрын
I think this is what i need to be mid after almost 2 yers of commercial work and more years hobby coding ;) Ty!
@asithathennakoon3431
@asithathennakoon3431 Жыл бұрын
Keep up the good work bro..
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you!
@owenwijaya108
@owenwijaya108 Жыл бұрын
this is fucking gold, you earned an instant subscriber!
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thanks for the sub! Appreciate it!
@owenwijaya108
@owenwijaya108 Жыл бұрын
@@brettwestwooddeveloper don't even mention it, you greatly deserved it bruh
@jenniferjohnston9236
@jenniferjohnston9236 Жыл бұрын
great tutorial! you should do one of these with next-auth-sanity
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Great suggestion! Only tried sanity once
@R6videos6R
@R6videos6R Жыл бұрын
Wow, you resolved my problem. Anywhere in the documentation was the error handling with the callback.ok and callback.error
@mattburgess5697
@mattburgess5697 Жыл бұрын
This is a great and very helpful video, going through several different ways of logging in a user. Just one thing though… it’s not Prism. It’s very clearly PrisMA.
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thanks!
@samuelpalacios9661
@samuelpalacios9661 9 ай бұрын
Hey Brett, amazing tutorial, one question, why you dind't use the Session model that next-auth provides as a starter code for prisma schema? (I guess its because that if we use jwt, the sessions will not be saved on the db)
@p.durgashankar4464
@p.durgashankar4464 Жыл бұрын
Best explanation.
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you!
@bengraham1798
@bengraham1798 11 ай бұрын
Thank you 🙏
@brettwestwooddeveloper
@brettwestwooddeveloper 11 ай бұрын
You are welcome!
@nobody2937
@nobody2937 10 ай бұрын
Thank you very much... Thank you ...
@user-iy5br7be2l
@user-iy5br7be2l 10 ай бұрын
Good job sir really impressive content. Thank you very much for sharing. 1. On a purely cosmetic side, in the login page, instead of the h1 "Sign into Github below" , I would rather change the button label to "Sign into Github". Same goes true for Google. 2. Are you planning to add a "reset forgotten passwords" functionality, since this is the "Ultimate" guide ? Best regards.
@prashlovessamosa
@prashlovessamosa Жыл бұрын
Thanks man
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
You are welcome!
@ahmetsakrak
@ahmetsakrak 8 ай бұрын
It's a truly informative and well-made video. I still have two lingering questions. First, what difference does it make in the underlying operation of Next Auth if we don't specify 'jwt' as a strategy? Second, why didn't you touch upon the topic of Middleware? It's crucial for user experience.
@mubashirwaheed474
@mubashirwaheed474 9 ай бұрын
Thanks you so much for this video. Can you please make video on role based authentication?
@brettwestwooddeveloper
@brettwestwooddeveloper 9 ай бұрын
No problem! And yes I can take a look into that, so something like admin login, user login, etc? protecting routes?
@mubashirwaheed474
@mubashirwaheed474 9 ай бұрын
@@brettwestwooddeveloper I have come across simple role based authentication videos but not ultimate guide per say. Role based authentication of user and admin using mongodb, prisma and next-auth. The major point of learning can be how to secure pages and then give access to certain routes only to the admin . For example: home and dashboard should be a protected route but only admin can access the dashboard.
@ekchills6948
@ekchills6948 Жыл бұрын
You're the best thank you ❤️
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
You are welcome!
@ekchills6948
@ekchills6948 Жыл бұрын
@@brettwestwooddeveloper i just finished and its really alot of information to digest, especially the way the google and github user is added to the database )): but overall I loved it
@reynaldobocaling4200
@reynaldobocaling4200 4 ай бұрын
Please another tuts about next js with typescript, thankyou brother❤
@ozgursar5386
@ozgursar5386 11 ай бұрын
Thank you for the nicely structured and detailed tutorial. I just couldn't understand how the signin to OAuth providers created the Account and User documents in mongodb.
@brettwestwooddeveloper
@brettwestwooddeveloper 11 ай бұрын
My most recent videos go more in depth about session data/object. I would recommend console logging profile, user, session and all to see what data you get back
@mediacreatif
@mediacreatif Жыл бұрын
In the async authorize(credentials) function, I would fetch an API login. It's more clear for me. There is an API to register and there is an API to login.
@Jerac07
@Jerac07 Жыл бұрын
Great tutorial!!! One of the best I've seen. Quick question : How would you make an admin account that would see all other account is some sort of table?
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
thank you! and you would have to create a custom value for admin signups through the login functionality. I would have to look into it more, and when I get good with it I can create a video on that topic. That is a very good topic that would be helpful!
@Jerac07
@Jerac07 Жыл бұрын
@@brettwestwooddeveloper thank you alot. That would be super helpfull. Keep up the good work and all the best from Zagreb, Croatia!
@hardrockwebdevelopers3383
@hardrockwebdevelopers3383 Жыл бұрын
Thanks!!! 😁
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
No problem!
@abdrahim9307
@abdrahim9307 Жыл бұрын
Good content (Y)
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you!
@marmeladovsvid
@marmeladovsvid 11 ай бұрын
ty
@brettwestwooddeveloper
@brettwestwooddeveloper 11 ай бұрын
no problem
@goldmikanik8274
@goldmikanik8274 8 ай бұрын
Thank you for the explanation, just a question please, when user register he actually doesn't get auth cookies, he needs to signin after that to get them right? If yes, is there a way to tweak that, would be nice if user can register and start using his dashboard for example. Thank you again.
@OnlyJavascript
@OnlyJavascript Жыл бұрын
at the end ..TS will get compiled to JS. that's browser's language. TS is like wearing armor while you eat breakfast. don't worry, i don't spill.
@armant11
@armant11 5 ай бұрын
Videos are so good. I just hate when he says prism when it's prismA with a A at the end??😂
@brettwestwooddeveloper
@brettwestwooddeveloper 5 ай бұрын
hahahah sorry about that. I truly can't pronounce it right even if I wanted to
@mryoung205
@mryoung205 11 ай бұрын
i loved this ... and i added next auth to my project. but i still dont know how to protect a sever side page... i am getting error in my seversideprops
@17Kpa
@17Kpa Жыл бұрын
If I need to bring me the user id and the roles, how would I do it? Great Video !
@dhavalbhimani1952
@dhavalbhimani1952 2 ай бұрын
Bro great video but I want to learn more about middleware stuff with google provider. Please help with that
@StartNight-df3sv
@StartNight-df3sv 3 ай бұрын
Excellent tutorial. Unfortunately its not completed without JWT token option. Btw, you must modify your system environment for KZfaq tutorials. I mean your display resolution must not exceed 1080 HD Now all your screen texts are very tiny and makes a lot of eye strain.
@lostinthenarrativve
@lostinthenarrativve 11 күн бұрын
Hey man, which of these videos should I watch first, this or the one that's titled "Nextauth credentials provider" ?
@brettwestwooddeveloper
@brettwestwooddeveloper 5 күн бұрын
I would watch this one first because it goes over everything. There is a new version of Next-Auth which is in beta. However, you can still use this video as a guide and is still relevant. I have other videos as well on my channel going over the session object and much more!
@merumeruedit
@merumeruedit Жыл бұрын
Ty for your good tut i have a question what plugin you use that show auto complete before coding?
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thanks and its called github copilot
@jesustzinon
@jesustzinon 11 ай бұрын
If is not too much to ask, can you expand these series of videos of auth by adding password recover and normal and admin user roles?
@brettwestwooddeveloper
@brettwestwooddeveloper 11 ай бұрын
Yes I can do that, I already have recent videos on next auth jwt session
@madanmalhotra
@madanmalhotra 9 ай бұрын
Our next PM will be 👉👉Brett 👏
@mediacreatif
@mediacreatif Жыл бұрын
For security purpose, you should not return the hashed password in the API register code. Just return the name and the email.
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
correct
@storyPlus12
@storyPlus12 7 ай бұрын
After route protection, when I write the login route manually in the search bar, it will show the login page for a while and then disappear which is not a good user experience.
@brettwestwooddeveloper
@brettwestwooddeveloper 7 ай бұрын
If you are calling the user on the client side with the useSession hook. Then it will cause that. You must fetch the user on server with the getServerSession. I am assuming you are calling the session client side?
@storyPlus12
@storyPlus12 7 ай бұрын
@@brettwestwooddeveloper Yes I am using in client as my compo is in client side. Do you have any repo or a blog post about it ?
@brettwestwooddeveloper
@brettwestwooddeveloper 7 ай бұрын
no I don't but you will have to refactor your code so your page is a server component and then fetch the session on the server. Then any client components necessary. Impot them into the server page. Does that make sense? @@storyPlus12
@storyPlus12
@storyPlus12 7 ай бұрын
@@brettwestwooddeveloper Thank you for the help. I got it and just solved ..
@hafsahussein2016
@hafsahussein2016 6 ай бұрын
is there any way to prompt the custom errors in the register router? because something went wrong doesn't make sense, the user wants to know what is wrong.
@Dhanushsaji
@Dhanushsaji Ай бұрын
I think for protected route we should use middleware page
@brettwestwooddeveloper
@brettwestwooddeveloper Ай бұрын
Yes ideally you should, but you can use it on individual pages as well if you want per the documentation.
@huyphamminh6911
@huyphamminh6911 Жыл бұрын
i have a question, when you log in, next auth give you 3 tokens (next auth handled it), but how about when you sign up, you sent back user object via json, so we cant get the session when you sign up right
@fadilarfat4974
@fadilarfat4974 Жыл бұрын
can you make a continuation video of this to deploy, i got a trouble to deploy it all of the authentication is not working after i deploy it
@yongsujeong7870
@yongsujeong7870 Жыл бұрын
This is the best tutorials I have seen on KZfaq Awesome! Could you tell me the reason why we need to add "/test" url at the end of the DATABASE_URL? Thank YOu!!
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
thank you for the compliment and technically you can have whatever name you what instead of test. This will be your collection name in mongodb
@yongsujeong7870
@yongsujeong7870 Жыл бұрын
@@brettwestwooddeveloper Really appreciate your answer!! Have a wonderful day!!!!😄😄
@johndeer8405
@johndeer8405 Жыл бұрын
Hi, can you do a really short video showing us how to setup a DELETE api route handler with and without prisma or at least with prisma. The new way in next13(app) is a bit confusing. Thanks for the content!
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Yes I can start working on it
@johndeer8405
@johndeer8405 Жыл бұрын
@@brettwestwooddeveloper thanks Brett, you are appreciated.
@Adrian-mu8gg
@Adrian-mu8gg Жыл бұрын
did i miss where the app is going to handle resetting password for credential provider? do you hv a tutorial on how to do that, and to assign role?
@WM-fz5si
@WM-fz5si Жыл бұрын
Hi Brett that's a brilliant video! God bless you!💯 Also please can you make video on jwt token with accesstoken as well as refresh token from cookies approach for same login.
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Thank you! I can look into that
@WM-fz5si
@WM-fz5si Жыл бұрын
@@brettwestwooddeveloper That will be really helpful! 😇Brett
@WM-fz5si
@WM-fz5si Жыл бұрын
@@brettwestwooddeveloper When can we expect this video?
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
@@WM-fz5si Within the month, I am currently working on Google auth video with database connection
@WM-fz5si
@WM-fz5si Жыл бұрын
@@brettwestwooddeveloper Sounds good 😊👍Thank you for your response 🙌
@user-kk5kp2lt8w
@user-kk5kp2lt8w 10 ай бұрын
Hey! Im using the same code in my project but when im connecting to the google provider, im receiving the data from google and getting the session as well, but somehow prisma is not storing my google account in Account model in the mongodb. Can someone help? I have looked to almost all possible error but cant figure it out!! Help would be appreciated
@MrKeliv
@MrKeliv 10 ай бұрын
I love your video. I want to ask about protect the page with user has not been authenticated ? How to do that ? Thank you
@brettwestwooddeveloper
@brettwestwooddeveloper 10 ай бұрын
Thank you and you just have to create a middleware file on the root of the whole project. export { default } from "next-auth/middleware" export const config = { matcher: ["/dashboard"] } This protects the dashboard page
@MrKeliv
@MrKeliv 10 ай бұрын
@@brettwestwooddeveloper Ok thank you. I already watch in another video. It has two option server side or client side. Glad to watch your video and help
@SingleSeeker
@SingleSeeker 11 ай бұрын
what about the get refresh token strategy?
@BenLamptey
@BenLamptey Жыл бұрын
Hey Brett, I've seen other tutorials where "mongoose" is used. I'm new to react/next etc...am I right in saying "mongoose" and "prisma" help setup schema's ? so we can use one or the other? if this is true, whats the benefits of using prisma ?
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
Yes correct, I have seen ways that you can use mongoose and don't have to use prisma. Just a preference when it comes to coding
@BenLamptey
@BenLamptey Жыл бұрын
@@brettwestwooddeveloper ah okay I see. Thanks for the quick reply.
@nicolaichristensen6531
@nicolaichristensen6531 Жыл бұрын
Mongoose is a false layer of security, it gives no benefits apart from abstraction of the default mongodb sdk. You can send whatever the frick you want to your mongodb, and that's not ideal, so SQL is usually better than Mongodb. When I say usually, I mean 99.99% of the times.
@fixesdev
@fixesdev Жыл бұрын
Hi, nice video btw! Im very thankfull! One doubt, in the object of useSession i am not receiving and status key? is there a reason for that?
@fixesdev
@fixesdev Жыл бұрын
nevermind, i got it!
@K0stur
@K0stur 9 ай бұрын
Idk if someone else asked... I don't know much about Prisma, but is there a reason ti pick it over Mongoose? I thought Prisma is more suited for SQL db's. I just started the vid but this seems like it is what I was after.
@brettwestwooddeveloper
@brettwestwooddeveloper 9 ай бұрын
Thanks for tuning in and you can use either honestly
@rod6722
@rod6722 7 ай бұрын
Curious why you didn't use the session model? As is suggested in the Next Auth docs on the Prisma adapter.
@brettwestwooddeveloper
@brettwestwooddeveloper 7 ай бұрын
Should have for tutorial purpose. But either way is fine. Definitely recommend using the adapter.
@ronokoushique7434
@ronokoushique7434 5 ай бұрын
@@brettwestwooddeveloper I don't understand why it's not working automatically when I am using the adapter. Should I have to change anything for the session table to get populated automatically? plz help
@liveinorganic4542
@liveinorganic4542 11 ай бұрын
Why I am getting error in axios.post('api/register, data) line when register. 'prisma.user.findUnique()' invocation. Please help
@0zankurt
@0zankurt 8 ай бұрын
Could you please make a video for laravel sanctum version of this?
@brettwestwooddeveloper
@brettwestwooddeveloper 8 ай бұрын
Hi, sorry I have never used that
@codingcambodia
@codingcambodia Жыл бұрын
Do you have a video using next-auth and role base access control,. Like basic , admin ... ?
@brettwestwooddeveloper
@brettwestwooddeveloper Жыл бұрын
no i do not
@lamechamalisrael
@lamechamalisrael 3 ай бұрын
Unfortunately, this isn't EVERYTHING I need. What I need now is to know why the adapters work in the development environment. But when I upload it to AWS Amplify, I cannot use the JWT to sign in any longer.
Next-Auth on App Router - Solid Auth, Super Fast
17:20
Jack Herrington
Рет қаралды 103 М.
Set up Google OAuth with Next.js using Next-Auth!
21:00
Build SaaS with Ethan
Рет қаралды 20 М.
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 5 МЛН
Вечный ДВИГАТЕЛЬ!⚙️ #shorts
00:27
Гараж 54
Рет қаралды 9 МЛН
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 109 МЛН
The Ultimate Guide To Next.js Route Handlers - CRUD
1:14:53
Brett Westwood - Software Engineer
Рет қаралды 5 М.
Build a Fullstack Login & Register Page with MERN (react.js, mongo, express, bcrypt, jwt & more)
1:50:04
Full Stack Authentication With Next.JS | Next Auth | Nest.JS
1:33:47
Comprehensive Authentication Tutorial in Next.js 14
3:25:43
Sakura Dev
Рет қаралды 32 М.
Дроны отбирают работу у грузчиков
0:15
Короче, новости
Рет қаралды 10 МЛН
ремонт саманных стен #дача #переезд #юг #весна
0:25
Переезд на Юг без денег
Рет қаралды 2,3 МЛН
万万没有想到这事小路飞的便便#海贼王  #路飞
0:14
路飞与唐舞桐
Рет қаралды 11 МЛН
Муравьи и нарисованные линии 🤯
0:24
FATA MORGANA
Рет қаралды 7 МЛН
The little girl just wanted to help 😭😳😔
0:45
Family Fast Five
Рет қаралды 7 МЛН
Safe
0:16
OHIOBOSS SATOYU
Рет қаралды 2,4 МЛН