Effortless Auth in Next.js 14: Use Auth.js & Drizzle ORM for Secure Login

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


This setup will enable users to log in to your app using social sign-in providers such as GitHub, with their user data securely stored in your database via Drizzle ORM.

Join this channel to get access to perks:

Chapters:
0:00​ Intro
0:52 Setup Next Auth
3:16 Next Auth Providers
4:16 Setup Github
6:50 Sign In
7:30 User Session
11:09 Drizzle Adapter
15:36 Session User id
21:24 Using the user id
24:25 middleware
26:14 Conclusion

🔗Moar Links
Рекомендации по теме
Комментарии
Автор

This is the Auth.js docs we all needed 😅

srymisclick
Автор

Amazing guide, I can't tell you how log I was brute forcing my way against the docs. The current state of web dev with the constant migrations and upgrades is tough, but I'm glad there are content creators like you putting out quality up to date content!

codingtranquility
Автор

this was disgustingly well done...recently went through the same steps and after rethinking my mental models i have to say this stack is looking pretty damn good. thanks for the brilliant video!

merveillevaneck
Автор

You nailed down every part of this setup that every one of us needed to know. Well done!
Liked and Subscribed for life! ❤

Crono
Автор

Sam, I was struggling quite a bit trying to implement the new auth method with drizzle and this REALLY helped me a lot. Thanks so much!! You've got a new suscriber 😉

ignaciogmg
Автор

This is so great. Finally after hours of staring docs I made the "simple" auth working :)

simonjanca
Автор

I am currently trying to update my website to have some special content for certain users. I think this is the route i'll be taking for my authentication. Thanks for the amazing explanation.

Diego_Cabrera
Автор

Needed this exactly! Been enjoying your videos, thanks a lot! Getting to learn a lot about S3 file management and securing your endpoints.

developerpranav
Автор

Now I get it. I have been struggling with the beta version \ docs. You got me over the hurdle 🙏🙏🙏🙏

AntNZ
Автор

Hey I've been trying to learn how to use auth.js into my application for several days now and I couldn't find any resource except yours that actually explains what parts you need and explain their role . Thank you so much for the video . I was wondering how did you learn how to use auth.js ?

darrenpierre
Автор

Thanks for this beauty !
Next time, Could you create a tutorial on how to use Lucia with Drizzle-Neon ?

fabouwes
Автор

Wait, you are using database strategy and middleware works? How come nextauth doc says only supports jwt when using middleware?

liu-river
Автор

at 24:41, what if I want to use my own login in my middleware before using NextAuth?

loo
Автор

Great tutorial! I think the Next.js Dashboard example from the official guide also uses the beta installation but for me, I don't really like to use beta or canary libs for production code. Are there any other options for implementing auth.js with Next.js 14 without using a beta package?

RedRobotDevelopment
Автор

can you please do a video on next-auth-cognito

AuthentCollabServices
Автор

for adding roles you would just add another field in your db and check if the role matches agaisnt your own criteria and safeguard either a page or part of your code? I think thats kinda what I got from reading docs. whats your opinion?

boyeverjoy
Автор

Sir, can you give me the name of the theme and font you use in your VS Code?

vasubhensdadiya
Автор

I have used drizzle and authjs drizzledapter for a while, but please make a video how to use custom credentials login with drizzle

universe_decoded
Автор

I ran into an issue where after pushing the schema that includes the user, verificationToken, session, account to my vercel postgres db, i get an error saying "Error: multiple primary keys for table "user" are not allowed" I've looked over my schema files and I am only declaring one primary key. I can't find any relevant help online and would really appreciate any help!

noelalfaro
Автор

Great lesson! Thank you!

I would still like to learn more about role modeling, so that some part of the site is only accessible to the admin.

And an additional question: is it possible to bind authentication via Next-Auth together with NextJS + NestJS, since I have the REST API built on Nest?

For example, so that some API requests are processed only for administrators.

parmetra