Next Auth - JWT & Session Callback & How to Update User Session

preview_player
Показать описание
In this video, I go over how to use the asynchronous callbacks of the JWT function and session function. This will allow you to use the JSON Web Token for your session data.

Also, I go over the update method provided by the useSession Hook. This allows you to update the session object.

Private 1 on 1 Help 👇

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

Time Stamps
0:00 Intro
1:18 getServerSession and UseSession Overview
4:24 Explanation of how the callbacks work
5:49 Creating a custom property inside of Register Endpoint
10:47 Create the JWT and Session Callbacks
21:48 The Update() Method
27:52 Update the user in database
30:42 Outro
Рекомендации по теме
Комментарии
Автор

Thank you for being (seemingly) the only person anywhere to explain the callbacks in NextAuth. This was a huge help!

ericwinkdev
Автор

This is my second tutorial from Brett, this was amazing thanks so much. You make wath seems very complicated and you simplify it for us. Thanks again

henrymunoz
Автор

Finally I found a way to do this, I searched everywhere but couldn't find it. Thanks, awesome video.

ergo
Автор

man you're doing great job. Nextjs has no many tutorials out there that highlight things as you do. Highly appreciated!

remarkablejames
Автор

Thank you so very much !! Your "The Ultimate Guide to Next Auth" video and this one are SUPER for beginners and probably the most thorough content on Youtube on Next-Auth. May be, if you have time and energy, sometime in future, a nice relaxed discussion, or a nifty little series on JWT + cookies + session + authentication + authorization + database session etc especially in light of NextJS + NextAuth would be fantastic. I guess this is how we beginners are !! Greedy !! :-). Once more, MAGNIFICENT, FABULOUS. THANK YOU SO VERY MUCH !!!

shumit
Автор

This is the best video on callbacks I have seen. Thank you for walking through it in such a systematic manner.

richardhulse
Автор

Great video man. Just what i needed. Everything explained clearly and perfectly.

AbhithShaji
Автор

You just earned a new follower bro. I have been struggling with session updates for a while but you just made it look so easy. Thanks ❤

davewilson
Автор

this video is wonderfull sir, i have watched many a videos related to next auth and was struggling with it since 1 month but after seeing your 2 videos all my doubts came to an end, this is the best video on internet on next auth, thank you soo much sir

satvik
Автор

Thank you so much for doing such high quality content around nextauth callbacks!! Helped me so much.

realmersx
Автор

Much better than other tutorials, thank you very much !

YorchCb
Автор

Thanks man ! it really helped a lot. No other tutorial regarding callback with mongo is out there. Would love to see more like these.😃

jackfrost
Автор

Dude, this earned you a subscribe, and i still didn't finish the video. Thanks!

ilirbajrami
Автор

Best of the best video and teaching style. Thumbs up. You solved my issue. Best regards

sheharwazir
Автор

Thanks for your great content! You're doing a great job at explaining. keep going :)

fakn
Автор

Thank you, you just help me solve my problem on adding additional session.

nestofbleu
Автор

Perfect video, just what i looking for!

DiegoRodriguez-mshz
Автор

Honestly, this is the best video ever on this topic. I've been struggling with NextAuth – "in my opinion, the documentation is either bad or I'm just dumb" – but it was explained so well! Subscribed.

fadlo
Автор

wish i could like this vid a hundred times.Thanks Brett🙌

emmanueladufo
Автор

bravo couldn't navigate next-auth in the app directory without you

bernardstein