Authentication with Next Auth and Next.js 14 | Protected routes, Server & Client Sessions

  Рет қаралды 8,714

WebDevJan

WebDevJan

Ай бұрын

Authentication with Next Auth and Next.js 14 | Protected routes, Server & Client Sessions
In this tutorial, I walk you through the process of implementing the latest version of NextAuth into Next.js 14. I cover how to set up OAuth login with both GitHub and Google, as well as creating protected routes by obtaining the session on the client and server.
Find the github repository here: bit.ly/4aAbWRk

Пікірлер: 34
@NoahCuz
@NoahCuz Ай бұрын
Part 2 with updating the session on the server would be greatly appreciated! Subscribed
@webdevjan
@webdevjan 29 күн бұрын
Part 2 is out now, have a look here: kzfaq.info/get/bejne/d9dkedalpqqXmYE.html
@ansarqazi4377
@ansarqazi4377 28 күн бұрын
The content is litreally so impressive. Everything is explained in quite simple way. Nothing extra in the video, just focusing on what actually needs to be done. Highly appreciated! Highly recommended! Thanks for the video.
@ansarqazi4377
@ansarqazi4377 Ай бұрын
Very useful content, quick, no time-wasting. Highly recommended! 🔥🔥🔥🔥
@webdevjan
@webdevjan Ай бұрын
Appreciate it bro!
@Twinkling-wy1dp
@Twinkling-wy1dp 29 күн бұрын
Very useful content, thank you very much, solve my problem
@captaintechworld
@captaintechworld 24 күн бұрын
Subscribed, impressive stuff !!
@jhoanmiguelescobararboleda8547
@jhoanmiguelescobararboleda8547 Ай бұрын
Yes nice, Question, what about I want to go to another page, if he is not log in, I want to show that page does not have accesss.. or redirect, do you do that in the middleware?
@srivatsans3723
@srivatsans3723 22 күн бұрын
Oh man, you saved my day.
@Prag1974
@Prag1974 27 күн бұрын
Hi Man. Great content. Thanks. But I have a problem: I want to use session based authentication strategy (as you know jwt is little bit unsafe) and I also credentials provider. When I adjust credentials provider in auth.ts and other files, next auth throwing error something like " 'session': 'database' strategy doesn't support credentials provider" is there any way to fix it? if not, can you suggest me a library that allow users credentials login and uses session based strategy. What should I do? Thanks.
@DhaouJawhar
@DhaouJawhar 17 күн бұрын
Subscribed, impressive stuff !! just on the point ♥♥♥
@webdevjan
@webdevjan 17 күн бұрын
Thank you so much
@ansarqazi4377
@ansarqazi4377 Ай бұрын
Highly appreciate!
@user-zn7fm1su8x
@user-zn7fm1su8x 19 күн бұрын
Thank you Jan
@sahebbeshra7659
@sahebbeshra7659 Ай бұрын
And if possible can you login using email and socials for appwrite with nextjs with both server and client. Please do it because no one KZfaq has done it properly
@shanumehra7088
@shanumehra7088 Ай бұрын
Hi Yan , Followed your video, Amazing work and looking forward for new videos. Just needed to ask a question that while getting the session data on client side you've used useSession() , cant we use the same function on the server as well for getting the same session data ?
@webdevjan
@webdevjan Ай бұрын
Thanks! Once I have some free time, I'll definitely dive deeper into the nextauth series and create a part 2. In that, I'll explore the credentials provider and provide more in-depth information. :) The useSession hook is specifically designed for client components, meaning you can't utilize it on the server side. To address this limitation, nextauth introduced the getServerSession function, which performs the same task on the server.
@shanumehra7088
@shanumehra7088 Ай бұрын
​@@webdevjan Wow great, Now got the point. Thanks !! 😇😇
@sahebbeshra7659
@sahebbeshra7659 Ай бұрын
Ya we need part 2 with email and password and also save user in data base for google and github login
@webdevjan
@webdevjan 29 күн бұрын
Part 2 is out now, have a look here: kzfaq.info/get/bejne/d9dkedalpqqXmYE.html
@andremalt8255
@andremalt8255 23 күн бұрын
Thanks bro
@BuhuuRecords
@BuhuuRecords 14 күн бұрын
Can you tell what extension is showing you errors directly in the code?
@webdevjan
@webdevjan 14 күн бұрын
The extension is called "Error Lens"
@chesterxp508
@chesterxp508 7 күн бұрын
GoodJob!
@sungo9664
@sungo9664 18 күн бұрын
I will have your Desktop Wallpaper please!!!
@webdevjan
@webdevjan 18 күн бұрын
The wallpaper is called "Amazing Landscape" and I am using the program "Wallpaper Engine" from steam.
@mikhacavin
@mikhacavin 3 күн бұрын
part 2 kzfaq.info/get/bejne/d9dkedalpqqXmYE.html&ab_channel=WebDevJan
@shoaibshaikh0786
@shoaibshaikh0786 Ай бұрын
bro please upload part 2
@webdevjan
@webdevjan 29 күн бұрын
Part 2 is out now, have a look here: kzfaq.info/get/bejne/d9dkedalpqqXmYE.html
@DudeFrom1972
@DudeFrom1972 26 күн бұрын
Ithinkitwasveryinteresting,hower,Igottiredinmyheadasyoudidmakeanynaturalpausesinyournarration.
@webdevjan
@webdevjan 26 күн бұрын
The video has jump cuts since most people have the attention span of a goldfish nowadays in this TikTok/short-form content era. If it wasn't cut down like this, a lot of viewers would just click away after 30 seconds. However, I appreciate your feedback.
@DudeFrom1972
@DudeFrom1972 26 күн бұрын
@@webdevjan Thank you for replying. May I suggest that you create and publish your videos in two versions: a short and a longer one and then provide a link for the short version in the long version and vice versa - a positive side effect of this is that you'll double your content with very little effort on your part.
@levimorais3641
@levimorais3641 13 күн бұрын
idk why but i keep getting error 404 when clicking the button and the terminal shows this GET /api/auth/session 404 in 456ms GET /api/auth/session 404 in 32ms POST /api/auth/_log 404 in 32ms POST /api/auth/_log 404 in 15ms GET /api/auth/providers 404 in 44ms POST /api/auth/_log 404 in 40ms GET /api/auth/error 404 in 27ms and the session object is undefined
Set up Google OAuth with Next.js using Next-Auth!
21:00
Build SaaS with Ethan
Рет қаралды 18 М.
Next Auth Credentials Provider - Ultimate Guide
50:01
Brett Westwood - Software Engineer
Рет қаралды 46 М.
Pray For Palestine 😢🇵🇸|
00:23
Ak Ultra
Рет қаралды 34 МЛН
Can you beat this impossible game?
00:13
LOL
Рет қаралды 48 МЛН
[柴犬ASMR]曼玉Manyu&小白Bai 毛发护理Spa asmr
01:00
是曼玉不是鳗鱼
Рет қаралды 50 МЛН
All 29 Next.js Mistakes Beginners Make
1:45:10
ByteGrad
Рет қаралды 53 М.
Next.js Authentication With Next-Auth V5 || Google & GitHub
37:29
tapaScript by Tapas Adhikary
Рет қаралды 2,1 М.
Next js 15 is Here… New Changes Again?!
8:13
JavaScript Mastery
Рет қаралды 93 М.
Master NextAuth v5: Next.js Authentication Made Easy
31:35
Code Ryan
Рет қаралды 1,9 М.
Power up all cell phones.
0:17
JL FUNNY SHORTS
Рет қаралды 50 МЛН
Эволюция телефонов!
0:30
ТРЕНДИ ШОРТС
Рет қаралды 6 МЛН
Pratik Cat6 kablo soyma
0:15
Elektrik-Elektronik
Рет қаралды 8 МЛН
Will the battery emit smoke if it rotates rapidly?
0:11
Meaningful Cartoons 183
Рет қаралды 2,7 МЛН