Finally, someone not using 3rd party libraries to implement authentication. Thanks for this!
@karacan246916 күн бұрын
You've made an excellent point! The reliance on third-party libraries has become so common that I've developed a bit of an aversion to using many of them myself. This creator is a skilled developer, and the video is incredibly useful. I hope they continue making content like this!
@stacksagar17 күн бұрын
as a developer, for me one of the best nextjs auth concept tutorial with clean and clear
@yonathanhailemelekot5238Ай бұрын
The most underrated React/Next.js YT channel. you deserve more recogition Sir.
@hikmetmelikАй бұрын
Sir, you are the best instructor ever. I started a brand new project with Next.js and you uploaded a fresh new video right on topic. Thank you! (I commented before watching it, I'm sure it's great anyway ) 🔥
@kunnykk6468Ай бұрын
Finally, the Next.js course is up! I knew you’d come through, dude🔥
@ShaynPutnamАй бұрын
Literally just found this dude yesterday, and today he puts out a video of EXACTLY what I was looking for!!!
@MrDerterminator1992Ай бұрын
Thank you so much for showing the bare minimum to really understand the required steps in auth. FYI, you get the pending state as the third argument directly from useActionState hook. const [state, formAction, isPending] = useActionState(fn, initialState)
@shakil-the-coding-monster13 күн бұрын
very rare video on youtube. Thanks a lot!!
@denisshvets7768Ай бұрын
Just in time. I was researching the topic and this video came out. What a luck. Thanks.
@insensibilityАй бұрын
I was just watching one of your shorts, wishing you could do NextJS. You're awesome, man. I keep on recommending you to people wanting to learn React and Tanstack. You're the GOAT!
@mohamedsalimbensalem6118Ай бұрын
you're the best instructor I've ever found! I've been watching your tutorials since you had 1K subscribers. I'd really appreciate it if you could cover more about React Native.
@jaecheokkim9910 күн бұрын
Very clear and useful really appreciate it!
@BalaMathias27 күн бұрын
You just got yourself a subscriber! This is dope! I've always wanted something like this! Thank you so much. 👏
@farzany12 күн бұрын
Fantastic video! Thank you for clearly explaining every step!
@gagancg1433Ай бұрын
Great Video finally ! It would be nice to have auto refresh token implementation in nextjs
@WallQ29 күн бұрын
I make the compliments of everyone my own, thank you for this
@Amitkumar-ps1dtАй бұрын
I am from India I am big fan of you and your tutorial specific on React, and Next Kindly make some videos on node, express and Mongo also Your videos helps a lot Thanks Love from India
@sonuinnervoyage447 күн бұрын
Great video about the vanilla next authenttication! it would have been more better if you could've added how to store the user details and consume it in the components whenever required.
@jayelemartermulo8574Ай бұрын
thank you so much. you make it such that i can make a nextjs app with a separate backend without depending in 3rd party library
@merlinmeraldzАй бұрын
I really like your videos 🎉 Hopefully we get more NextJs videos. Thanks a lot for a well explained content.
@skia5155 күн бұрын
Seriously, I can't believe a big framework like NextJs don't have own authentication & authorization in-Built, programmer should make own auth system from scratch or using 3rd party libraries.
@Q-Productions23Ай бұрын
Hey, Bro Could you Please make this but in the scenario where Nodejs is the backend and Nextjs Frontend?
@serlismaldonado28 күн бұрын
This a great tutorial. Thanks!
@_andrewpeacockАй бұрын
Would *LOVE* to see some more content on Remix or the new Tanstack Start
@void-deusАй бұрын
wow thanks
@doomguy213518 күн бұрын
How to use session in client components??
@muhammadobaidullahkhan588719 күн бұрын
Thanks a lot buddy! I was just trying to add auth in my on going project and found ur tutorial, Thanks again <
@Farruh_13Ай бұрын
Do you plan to make a video about Front-end architecture?
@codesiusАй бұрын
I believe useActionState also now returns isPending state (the old useFormState did not), so I don't think you need to rely on useFormStatus just for pending anymore. I could be wrong though. It's been some time since I read the docs on it.
@LehmannMrАй бұрын
You should take a look at next-safe-action. This takes it even a step further.
@mehmethanifierenler3612Ай бұрын
very very thanks
@mounir1017 күн бұрын
Thanks bro, you're great and love the explanation. Please, could you do the same process using NextAuth lib?
@bharatdubey83Ай бұрын
WHEN WILL THE NEXT JS COURSE COME
@patrickamaechi1881Ай бұрын
would be great to also maybe include refresh token rotation just to extend the feature already implemented
@joelcontreras462922 күн бұрын
Thank you! This is just what I need but how do you resolve the hydrated warning?
@rgagankumar5191Ай бұрын
Great tutorial. Confusing part is how do i extend the session expiry time, when they are logged in Need help on this.. 🙏🏻🙏🏻
@kinggrey2511Ай бұрын
Can we have more interviews like proper interview I got asked questions like event loop, event bubling difference between http server and express etc stuff I know it was a kinda big company but iam a 3rd students like who ask those questions. I prefer these kind of interview questions please also thanks for your hooks playlist.❤❤❤❤
@cb73Ай бұрын
Good stuff… just a little side note on login validation. There is no reason to validate passwords when logging in.
@ElektronikZarmaaАй бұрын
Thank you. Where is the starter code? Is it a code-along tuto?
@niklausmikaelson7332Ай бұрын
Refresh token ?
@hieunguyen0801Ай бұрын
Can you make a video tutorial on custom fetch of nextjs like axios in a real project?
@ntone.sАй бұрын
Thanks for another great tutorial! Tried to run the project but received an error in terminal "Failed to verify session" after adding middleware.ts therefore login didn`t work. Also in session.ts two functions create and delete wants cookies to be awaited. Could you help please?
@sidalisaadi1961Ай бұрын
Great video! I would like to know how auth solutions like clerk work, do you have to make a request for their api each time you need to verify the auth? how does the hooks to get user work..?
@cosdensolutionsАй бұрын
You use their API as a backend, and then they also store cookies that the hooks use. It's basically what we did but they manage all for you and expose some hooks and components to use
@MrR4P70R28 күн бұрын
I'm surely missing something but, how do you call/categorize "jwt" when you say "without any 3rd party library" ?
@vira5995Ай бұрын
next video on nextauth Please🙏
@skia5154 күн бұрын
thanks for this video how can I check if user is logged in in home page? like if user logged in ? print his email other wise show login button
@novianto2346Ай бұрын
How about using react hook form for form handling? Can we combine the server action with react hook form?
@cosdensolutionsАй бұрын
yeah you can!
@seagull2345Ай бұрын
Same thing for React Native, please.
@StarkElessar24 күн бұрын
Thanks, but you didn't show getme - how do you know I'm logged in, you didn't show token update, interceptor on 401
@juansimonmerlo685428 күн бұрын
Excuse me i'm having a problem with useActionState and useFormStatus. I've already installed the same dependencies you had but I still get this error: "The 'react' module doesn't have any 'useActionState' exported. Same error with react-dom and useFormStatus. Thanks!
@kennethlau8108Ай бұрын
can this tutorial to be redone in nextjs 14 without useActionState as nextjs 15 is still quite buggy for production.
@jujudev728 күн бұрын
Someone knows how to see details on hover (14:36) in VS Code ? The name of the extension please ? 🙏 Thank U for the Tuto 🙌
@balduin_b4334Ай бұрын
did you verify that the middleware is working on a vercel deployment of nextjs? i dont think it works because jose isnt edge runtime compatible.
@abuzain85924 күн бұрын
Your solution is solid, but the logic in the middleware isn’t fully accurate in a few production cases. I’d submit a pull request, but since you’ve combined all the video code into a single standalone repo, it’s not feasible. Here’s the issue with your middleware code: typescript Copy code if (isPublicRoute && session?.userId) { return NextResponse.redirect(new URL("/dashboard", req.nextUrl)); } Currently, this line redirects the user to the dashboard if they’re logged in and trying to access a public route. However, consider that some pages-like marketing or landing pages-should be accessible to all users, regardless of login status. This code would redirect logged-in users to the dashboard, which isn’t always correct. A better solution would be to categorize pages into three main types: protected, public, and neutral. Then, if the user is trying to access a public route and has a session ID, redirect them.
@harou22Ай бұрын
Can you not crash the server by spoofing the formData requests and sending e.g. null instead? Object.fromEntries(null) will throw with type error.
@Sardorbek-Safarov27 күн бұрын
How can we get the token if we need to use it on client side?
@vikashmaurya9824Ай бұрын
How I can implement csrf token in nextjs with authentication?
@waleedsharif618Ай бұрын
Same steps with NextJS 15 ? Which released today
@cosdensolutionsАй бұрын
yeah this is 15
@dasarimanoj3086Ай бұрын
Are we actually getting Next.js tutorials on this channel?
@cosdensolutionsАй бұрын
What do you mean?
@dhanrajshetty645Ай бұрын
@@cosdensolutions Since you post react videos that's why.
@cosdensolutionsАй бұрын
Yeah sure, but that comment felt like it was a bad thing and I just wanted to clarify and understand
@dasarimanoj3086Ай бұрын
@@cosdensolutions Noo 🥲sorry if I have framed the question in that way. I was asking can we expect more of nextjs content on this channel further going is what I was requesting you 😅
@datle2863Ай бұрын
Is the middleware file actually used here or it is just for server simulation? I dont see you use it anywhere so im curious
@cosdensolutionsАй бұрын
Next.js automatically uses it and runs it before every request
@tonyvito5062Ай бұрын
Not secure tho and could have a lot of issues since you're not refreshing that jwt token
@modelzero54637 күн бұрын
where is project start code?
@EmilWallАй бұрын
passwrong 😂😂
@m7mdnho15426 күн бұрын
NextResponse.redirect("/login") throws an error. I solved it by doing NextResponse.redirect(new URL("/login", res.url))