Next-Auth V5 Tutorial (OAuth, Email, Server Actions, Server-Side Auth, Client-Side Auth, Roles)

preview_player
Показать описание
-How to implement Google and GitHub login via OAuth2
-How to create email magic links with Resend
-How to add an admin role
-How to protect server components, client components (via useSession), server actions, and API route handlers
-The difference between server-side and client-side session retrieval
-The pros and cons of session vs JWT authentication
-How to achieve static caching on pages that contain auth
-How to make your Prisma client work on the Edge runtime (middleware)
-How to cache your session requests between server components
-How to update user data from the frontend
-And more

Project files:

📣 Follow Coding in Flow on social media:

Timestamps:
0:00 - What we will cover
3:37 - Project setup + Vercel Postgres database
9:51 - Next-auth setup + Prisma adapter
25:53 - Google & GitHub login (OAuth2)
40:46 - Authentication in server components
55:31 - Protecting pages
1:00:35 - Authentication in server actions (& API route handlers), updating user data
1:13:51 - Deduplicating auth requests with React cache
1:17:23 - Client-side authentication (SessionProvider, useSession), vs Partial Prerendering
1:29:05 - Session callback (adding more data to user object)
1:34:56 - Email magic links (Resend)
1:40:36 - Deployment (Vercel)
Рекомендации по теме
Комментарии
Автор

i really like how you not only explained it all extremely well, but also emphasised on the optimisation techniques

tabishnaqvi
Автор

Your channel is like one stop solution for everything Next.js💖💖

bhargavkumar
Автор

Hey man I never comment in videos, but you saved me from a pain in the ass that is to understand the docs from auth.js. Thank you a lot, much love from brazil.

vnxcius
Автор

You know I was stuck in next auth , and I was hoping you to make a video about it, now u did it 😍😍😍
Thank you sooo much u deserve more support 👏🌹

mnhtada
Автор

Project with Next js, mongoDB with or without prisma, next auth, files upload using uploadthing, and so on ❤

senselessplays
Автор

The best channel I ever had. I appreciate you for the special work you are doing. Thank you.

Leesdjo
Автор

very well orginized & easy to follow along. Thank you for effort. Would love to see Drizzle version tough 😃

muratasarslan
Автор

I kept having wow moments while watching this tutorial. Remarkable resource. Keep it up and Thank you

henryokeke
Автор

I love the Open Sourece Project videos please continue the videos

gzmqwbx
Автор

This is why i love this channel. Thank you so much for your work, you deserve more subscription

dosamuel-mb
Автор

Yeeeeahhh, I really needed this, I've been stuck trying to update a project from v4 for 2 weeks

tushswe
Автор

best video on Next Auth BY FAR 🔥 well done bro

thewiseowlclub
Автор

Genuinely a fantastic video, subscribed. Would you be willing to cover how to wrap a route in auth() as shown in the docs?

alfredmadere
Автор

You literally read my mind!! I really needed this tutorial and you are the best person for this

zyncc
Автор

thankyou for this really helpful tutorial for my journey to master next js! 34:41 caught me off guard 😂😂😂

lqcs
Автор

You are always the best .. appreciate your time and efforts making these great videos ❤

abdelrahmanmagdy
Автор

Bigman, this is incredible. Thank you for this. Learnt a lot.

pacrapempire
Автор

Would love to see a Next.js project which utilizes BLOB storage, maybe like a simple video/audio sharing platform!

dan
Автор

Thank you for your video! keep the good work coming

fixesdev
Автор

Great I was looking to use Next Auth in my new project maybe

jeanmaxme