Тёмный

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

WebDevJan
Подписаться 571
Просмотров 15 тыс.
50% 1

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

Наука

Опубликовано:

 

11 апр 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 36   
@NoahCuz
@NoahCuz 2 месяца назад
Part 2 with updating the session on the server would be greatly appreciated! Subscribed
@webdevjan
@webdevjan 2 месяца назад
Part 2 is out now, have a look here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Aq4FstAD3iM.html
@ansarqazi4377
@ansarqazi4377 2 месяца назад
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 2 месяца назад
Very useful content, quick, no time-wasting. Highly recommended! 🔥🔥🔥🔥
@webdevjan
@webdevjan 2 месяца назад
Appreciate it bro!
@Twinkling-wy1dp
@Twinkling-wy1dp 2 месяца назад
Very useful content, thank you very much, solve my problem
@captaintechworld
@captaintechworld 2 месяца назад
Subscribed, impressive stuff !!
@DhaouJawhar
@DhaouJawhar Месяц назад
Subscribed, impressive stuff !! just on the point ♥♥♥
@webdevjan
@webdevjan Месяц назад
Thank you so much
@Racine14
@Racine14 17 дней назад
This is awesome tutorial.
@ansarqazi4377
@ansarqazi4377 2 месяца назад
Highly appreciate!
@jhoanmiguelescobararboleda8547
@jhoanmiguelescobararboleda8547 2 месяца назад
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 2 месяца назад
Oh man, you saved my day.
@user-zn7fm1su8x
@user-zn7fm1su8x Месяц назад
Thank you Jan
@Prag1974
@Prag1974 2 месяца назад
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.
@mateokladaric
@mateokladaric 27 дней назад
how does your terminal autofill stuff, that's new to me!
@andremalt8255
@andremalt8255 2 месяца назад
Thanks bro
@sahebbeshra7659
@sahebbeshra7659 2 месяца назад
Ya we need part 2 with email and password and also save user in data base for google and github login
@webdevjan
@webdevjan 2 месяца назад
Part 2 is out now, have a look here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Aq4FstAD3iM.html
@sahebbeshra7659
@sahebbeshra7659 2 месяца назад
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 RU-vid has done it properly
@shanumehra7088
@shanumehra7088 2 месяца назад
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 2 месяца назад
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 2 месяца назад
​@@webdevjan Wow great, Now got the point. Thanks !! 😇😇
@chesterxp508
@chesterxp508 Месяц назад
GoodJob!
@BuhuuRecords
@BuhuuRecords Месяц назад
Can you tell what extension is showing you errors directly in the code?
@webdevjan
@webdevjan Месяц назад
The extension is called "Error Lens"
@sungo9664
@sungo9664 Месяц назад
I will have your Desktop Wallpaper please!!!
@webdevjan
@webdevjan Месяц назад
The wallpaper is called "Amazing Landscape" and I am using the program "Wallpaper Engine" from steam.
@shoaibshaikh0786
@shoaibshaikh0786 2 месяца назад
bro please upload part 2
@webdevjan
@webdevjan 2 месяца назад
Part 2 is out now, have a look here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Aq4FstAD3iM.html
@mikhacavin
@mikhacavin Месяц назад
part 2 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Aq4FstAD3iM.html&ab_channel=WebDevJan
@DudeFrom1972
@DudeFrom1972 2 месяца назад
Ithinkitwasveryinteresting,hower,Igottiredinmyheadasyoudidmakeanynaturalpausesinyournarration.
@webdevjan
@webdevjan 2 месяца назад
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 2 месяца назад
@@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 Месяц назад
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
Далее
Oh, Auth Doesn't Have to Suck?
7:16
Просмотров 56 тыс.
50 YouTubers Fight For $1,000,000
41:27
Просмотров 62 млн
Is HTMX a Joke??
32:15
Просмотров 18 тыс.
Next js 15 is Here… New Changes Again?!
8:13
Просмотров 130 тыс.
7 Years of Software Engineering Advice in 18 Minutes
18:32
Supabase and NextJS 14:  Auth and Server Actions
1:19:31
Next-Auth on App Router - Solid Auth, Super Fast
17:20
Просмотров 105 тыс.