Next-Auth on App Router - Solid Auth, Super Fast

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 342

  • @branislavbrincko7237
    @branislavbrincko7237 Рік тому +84

    The most frustrating thing about Next auth is “The functionality provided for credentials based authentication is intentionally limited to discourage use of passwords”. But the email password auth is the most common request from clients, so that’s what I would love to see in this kind of tutorial.

    • @pranavrajveer3767
      @pranavrajveer3767 Рік тому +12

      Although as a matter of fact, day by day passwords are becoming a major source of security threats in this era, so it's not long before orgs move towards passwordless solutiions.

    • @FunkyToe369
      @FunkyToe369 Рік тому

      @@pranavrajveer3767 Nobody disagrees with that, but "not long before" is a key part of your sentence... we are not quite there yet and it is very frustrating how awkward they make it. In current day, people still want password auth.

    • @jherr
      @jherr  Рік тому +38

      As a service user I strongly prefer applications where I can login using auth from a trusted provider. Given the number of folks out there interested in home-brewing their own solutions I, as a user, don't really have much trust in those solutions given the number of high profile breaches.

    • @bryson2662
      @bryson2662 Рік тому +1

      I think it's a good choice by Next auth. For learning purposes, it's good to know how to handle passwords and whatnot but realistically it's best not actually used.

    • @my_yt666
      @my_yt666 Рік тому +13

      A bcrypt implementation isn't so difficult, but then you need to do the whole boilerplate as well such as forgot-password, set-new-password-after-forgot, send-email-confirmation, resend-email-confirmation, confirm-email, change-password, change-email, confirm-change-email, etc.

  • @Murv
    @Murv Рік тому +14

    Thank you. The default documentation doesn't provide any app-router examples, leaving a beginner who just used the /api/ routes first time last night a bit stranded. Especially seeing as I don't have the attention span to sit through 40 minutes of video like the others.
    Straight to the point at the start with all the "example code" I need to understand how to structure it and then extend it with more providers, awesome !

  • @milkdrom3da
    @milkdrom3da Рік тому +14

    You will not believe the excitement in my eyes when i woke up this morning and seen this post after struggling and failing ALL YESTERDAY to figure out next-auth for the app router! THANK YOU AND GREAT TIMING

    • @skyhappy
      @skyhappy Рік тому +1

      Use clerk way easier

    • @milkdrom3da
      @milkdrom3da Рік тому

      @@skyhappy I'm def considering it.

    • @dharylovey
      @dharylovey 8 місяців тому

      also kinde@@skyhappy

  • @arjobansingh1940
    @arjobansingh1940 Рік тому +12

    There is one downside of fetching the session in root layout at 7:55 (as we needed to pass in the SessionProvider). The root layout becomes dynamic route as it uses getServerSession which internally uses next/headers, thus making the root layout route as dynamic.
    And as root route is dynamic, every nested page by default becomes dynamic(which is not case we would always want, its like running getServerSideProps on every request of any nested page) due to this, no page will be statically generated by Nextjs, which is though the default behaviour provided by Next 13.4+.
    And also it causes issues running static paths generated by generateStaticParams.

    • @jherr
      @jherr  Рік тому +4

      Agreed. You can scope that to either a sub-layout or into the page handler if you want to avoid that.

    • @tinhoCs
      @tinhoCs 10 місяців тому

      Good observation. Where would we ideally put it?

    • @jherr
      @jherr  10 місяців тому

      @@tinhoCs At the top of the dynamic layout.

    • @tinhoCs
      @tinhoCs 10 місяців тому

      @@jherr Thanks for the quick reply Jack. Any way you can paste a short snippet here just so I'm clear?

    • @jherr
      @jherr  10 місяців тому

      @@tinhoCs Sorry, no. There is a Discord server associated with this channel and you can request help there. Please READ and FOLLOW the #rules BEFORE posting. And the Next Auth folks have support channels as well.

  • @syntheticquimera6642
    @syntheticquimera6642 10 місяців тому +4

    You're the best! Dealing with all the changes that NextJS constantly goes through can be a real headache, and often the documentation doesn't provide much help. But you explain things so well!

  • @AmimulEhsaan
    @AmimulEhsaan 10 місяців тому +2

    THIS TUTORIAL SAVED ME after getting frustrated for an entire day of how to implement authentication using cognito in nextjs 13 appRouter. Thank you so much :)

  • @gorkemgok9313
    @gorkemgok9313 11 місяців тому +3

    I love how straightforward this tutorial is. For the last three days, I was trying to figure out how to use this library. Documentation is not clear with the use of SessionProvider. But Jack, you are the man.

  • @MarkGruffalo
    @MarkGruffalo 7 місяців тому +1

    !!! It didnt work for me until I switched from version '4.24.7' to the *beta* version!!!!
    Thanks for the awesome tutorial!!

  • @phptempaltedf
    @phptempaltedf 10 місяців тому +2

    after 10 tutorials and 9999 hours of tuto next.js. I feel of you and just "magique" . An 10 min, I fully understand SessionProvider

  • @PrayRNGesus69
    @PrayRNGesus69 Рік тому +2

    I can't believe how easy next-auth makes this painful process for me, thanks for teaching !

  • @mazen.alsenih
    @mazen.alsenih Рік тому +3

    Thank you Jack, I just discovered your channel yesterday, and I'd like to thank you for all great, quick, straight to the point, and up-to-date tutorials. for everyone who's having the type error with building, to fix it move authOptions to it's own file and export the handler from there, then import it and export it again in the route.ts

  • @zohaibakber3056
    @zohaibakber3056 Рік тому +15

    Awesome video Jack, maybe take it to next level with role based access and saving session and user info in database

  • @DivyanshuLohani
    @DivyanshuLohani 7 місяців тому +2

    Thanks mate for the setup I was literally stuck on this problem for over 2 days then I found this video

  • @jaroslavhuss7813
    @jaroslavhuss7813 Рік тому +2

    Every time I try to live with Nextjs, it's because of Jack. Jack is such a good tutor. Unfortunately, I always quit Nextjs because of the server's architecture which I really don't like. But then again - Jack released a new video and I am messing with Nextjs over again to find out how unhappy I am with the architecture... And then again, and again... and again... Anyway, I am subscribed to the Pro NextJS and buying the course asap!

  • @catchshyam
    @catchshyam Рік тому +5

    Thank you Jack, you are an amazing teacher and your tuts have the right amount of length and covers the exact amount details that I look for. I was working on the nextauth integration for a side project with credential provider and here was your video, talk of serendipity 😍
    If I have to nitpick, I think you could cover the following,
    1. nextauth middleware to handle redirection to login page for protected pages
    2. attaching the access tokens to external API calls from server and client API requests
    3. Customizing the auth pages
    I know these are advanced topics, may be for another video. Thanks again for making our lives easier.

    • @goddessworshipper
      @goddessworshipper 11 місяців тому

      Wow @catchshyam you nailed exactly the topics I was going to ask for! Excellent tutorial Jack. 1) middleware is important so that one does not have to repeat the same get session and redirect code on EVERY protected page (and open up the door for forgetting to do so) 2) getting the access tokens to APIs is a critical piece... it would be great to initialize a wrapper for that external API ONCE (like a singleton) that takes the access_token once, and make it so every page/route etc has the ability to call that API without individually getting the access token (normally a jwt token) and 3) customizing the auth page is also important, and fairly easy to do in the pages router version of Next.js but have yet to try in app router version.

  • @clemonsLA
    @clemonsLA Рік тому +1

    Honestly this video does such a great job at explaining the overarching ideas of auth these days. The fact that it happens to be on app router is the cherry on top. Thanks!

  • @JJGlyph
    @JJGlyph Рік тому

    This is the greatest authentication video ever made. React server actions are the best.

  • @traconisek
    @traconisek 6 місяців тому

    This is the most comprehensive, yet the most accessible nextauth tutorial (using app route ie easy to be adapted on t3stack etc.), I found :). Answered so many questions other treat as "trivial"! THANKS JACK!

  • @Silverdagger258
    @Silverdagger258 Рік тому +56

    You did not cover how one can implement their own provider - let's say I need to use both Github and my own database to authenticate users . Perhaps in a future video ?

    • @kapiqu2709
      @kapiqu2709 Рік тому +13

      And how to authorise user on database, like JWT (user from string)

    • @AmadeusTwi
      @AmadeusTwi Рік тому +1

      Hey! I tried to roll my own back-end with JWT Credentials Auth.
      As far as I know it's not possible in App Router if you're rolling your own server, because Next.js Server can't set the cookies, only read them. So if you're relying on JWTs, you won't be able to do much, unless you expose your access and refresh tokens from back-end - which you obviously do not want to have.
      This and other things are to be addressed in NextAuth v5, which is still in development.

    • @ammaraateeb1914
      @ammaraateeb1914 Рік тому +1

      The nextAuth is notorious when it comes to custom configuration. Jack help us 🙏

    • @igogs7095
      @igogs7095 Рік тому

      @AmadeusTwi I've managed to set JWT tokens with Next 12. I had troubles with them, but it's possible

    • @AmadeusTwi
      @AmadeusTwi Рік тому

      @@igogs7095 That is the point. Pages Router (Next.js 12) DOES work. App Router (Next.js 13) - DOESN'T.

  • @alexgochenour8740
    @alexgochenour8740 Місяць тому

    Great stuff. This helped me grasp the semi-magical approach NextJS takes to auth architecture. Thanks!

  • @YaronLavi
    @YaronLavi 4 місяці тому +1

    Thank you very much Jack!
    Quality videos as usual!
    That pro course sounds interesting 🧐

  • @dmltdev
    @dmltdev 10 місяців тому +1

    Still useful, and still relevant. I am extremely thankful for this video, as I was having really hard time implementing all of this. THANK YOU!

  • @wwtche
    @wwtche Рік тому +2

    wow, I watch a few tutorials on getting next-auth working but this one is so clear and concise. thanks for teaching us!

    • @vernevens1598
      @vernevens1598 8 місяців тому

      Me too, still looking at a blank screen not having a clue. Can't be done without daddy git I guess. This is almost making me want to go back to pounding nails for a living.

  • @neutron417
    @neutron417 11 місяців тому +1

    thanks man, didn't knew auth was that simple to implement

  • @azizkira7505
    @azizkira7505 10 місяців тому +1

    you have to make a lot of videos on youtube , you are the best teacher ❤

  • @Luigi-lw6xg
    @Luigi-lw6xg Рік тому +7

    Great video Jack, thanks for clearing the fog. Tell me would you have an idea how to protect routes by roles? So for example a user visiting with an admin role has read and write permissions on a page compared with users that have just basic view.

  • @blyfo
    @blyfo Рік тому +1

    Bloody love this guy! Thanks for everything Jack

  • @aliasalias510
    @aliasalias510 Рік тому +2

    I'd wish to have a similar quick tutorial on how to do localization (i18n) with Next.js - App Router.

  • @seccentral
    @seccentral Рік тому +1

    @12:42 - small verbal slip :)) should say "enable server actions" , not "server sessions". was a bit confused for a second. (Ty for this wonderful vid)

  • @jacobrebec4951
    @jacobrebec4951 11 місяців тому +1

    Thank you so much. This was so much clearer than all other resources I found for nextauth

  • @fAlekr1
    @fAlekr1 Рік тому +2

    omg, Jack is such a great explainer! I feel embraced by his tutorials, he's a fantastic teacher!!
    Cheers from Brasil! \o/

  • @bodywithoutasoul
    @bodywithoutasoul Рік тому +1

    Yes yes yes!!! I needed this! How is it that the next-auth docs have such horrible instructions for the new app router?!

  • @jd_27
    @jd_27 Рік тому

    Hi Jack, thank you very much for this detailed tutorial. It filled many of the gaps missing from the next-auth documentation. And your voice is smooth as honey

  • @oliastepko6240
    @oliastepko6240 10 місяців тому +1

    Thank you so much! Love your style of teaching! And a huge thanks from a beginner for the detailed explanation!

  • @imsantoshsingh
    @imsantoshsingh Рік тому +1

    Another fascinating video from Jack (the Codefather) 🤩

  • @bryson2662
    @bryson2662 Рік тому +1

    damn, Jack. You've got the best content. Thank you so much.

  • @RenardBergson
    @RenardBergson 10 місяців тому +1

    Thanks a lot bro! Your video was the only thing that cleared my mind. Now, I have a start point to use the other concepts. Sorry for my english and regards from Brazil!

  • @godhandinfamous
    @godhandinfamous 3 місяці тому +1

    thank you Jack, this is helping me getting started with the auth

  • @camstuart
    @camstuart 10 місяців тому

    Thanks Jack! I'd love to see a few things: 1) How can I call an external API (securely) by accessing the id token from the cookie (as I understand this to be the most secure way) and having any token refresh handled by next-auth. And then, 2) a rough overview of how a backend api might verify this request. Obviously thats tricky because there are so many languages and libs. so perhaps an express js example would be the simplest for people to translate. In my case to Golang. Finally 3) How can I make sure that any data fetching to external API's can be done after the session is all set up. EG, after a page refresh, I often get that flicker, and multiple call to my backend as the page loads and session initialises asynchronously!

    • @jherr
      @jherr  10 місяців тому +1

      There is a Blue Collar Coder Discord server where you can ask the community for answers to questions like these.

  • @grant_vine
    @grant_vine Рік тому +11

    You haven’t covered middleware, would be nice to add that 😊

    • @jherr
      @jherr  Рік тому +1

      Middleware for?

    • @grant_vine
      @grant_vine Рік тому +1

      @@jherr next-auth middleware implemention

    • @jherr
      @jherr  Рік тому

      @@grant_vine Hahah, yeah, I get it. To do what though? What do you want the middleware to do? Add roles to the headers or something?

    • @grant_vine
      @grant_vine Рік тому

      @@jherr it’s seems a logical central location for route protection and managing a common “why are you on this page”, so definitely supports DRY

    • @jherr
      @jherr  Рік тому +1

      @@grant_vine Is it DRY though? because you have the path for the route, which is truth, and then you replicate that path in the middleware to add protection. So if you move the route you'd have to change the middleware. Which doesn't seem DRY to me. Honestly, I'd be ok either way with this, I was just curious if there was a customer requirement that I didn't cover.

  • @NourElGhamry
    @NourElGhamry Рік тому +1

    Awezome 😂😂 , thanks alot Jak informative as usual

  • @DarknessDescending
    @DarknessDescending 7 місяців тому +1

    Really solid how to tutorial. Well done and thank you.

  • @amineayachi335
    @amineayachi335 Рік тому +1

    Thanks for the great content you provide MJack

  • @jotasenator
    @jotasenator Рік тому +1

    I like this a lot, and I noticed you were having a nice time too, regards and thanks !!!

  • @JasonLantz-r9f
    @JasonLantz-r9f Рік тому

    Hoping the family is doing well... thank you for the tech contribution....

  • @craigcaski
    @craigcaski Рік тому +2

    Just the video I needed! Thank you!

  • @nikhilev3840
    @nikhilev3840 11 місяців тому

    Awesome tutorial Jack! Loved it. Thank you

  • @aznravensdrive5900
    @aznravensdrive5900 9 місяців тому

    For the nav... when you click on Server Action... if you see "Who Am I" but you don't see your name? that's because you have to actually click on "who Am I" in order to see your name. "Who Am I" is a button not just text.

  • @xaxoxuxu
    @xaxoxuxu Рік тому

    Amazing, love your style, love the way you talk. Keep it up!

  • @sharpesthawk
    @sharpesthawk 10 місяців тому +1

    At 8:06 How did you highlight just some code and the rest is dim? Is that an extension of some sort? Is there a keyboard shortcut for that?

    • @jherr
      @jherr  10 місяців тому

      That's something we do manually in ScreenFlow to highlight the code I'm talking about.

  • @darshandev1754
    @darshandev1754 Рік тому

    The final point of passing headers to the GET request, was super needed I was stuck on it for days, not understanding why my GET requests weren't sending the headers even when I was authenticated

  • @roshandalami
    @roshandalami Рік тому +1

    Thankyou. Looking for a while . Finally next-auth is here

  • @chrisjones469
    @chrisjones469 3 місяці тому

    I'd really like to see an example of something more enterprise, if you could, such as Keycloak. The token refresh process is messy, and documentation is scarce around this. The general community doesn't seem to have produced a solid solution for enterprise-level authentication. Thanks for the great videos!

  • @juanruiz209
    @juanruiz209 5 місяців тому +1

    Thanks for the job. Really apreciate it a lot!

  • @RickyGarcia_Learning
    @RickyGarcia_Learning 4 місяці тому +1

    *heavy breathing* YOU FREAKIN' LEAKED THE CREDENTIALS!!!!

  • @_hugo_cruz
    @_hugo_cruz Рік тому +1

    Thanks a lot Jack. I love you explications.!!! Excelent video! I wait the course!!

  • @knload
    @knload Рік тому

    Happy to see a confirmation I am doing it right. Thanks

  • @soganox
    @soganox Рік тому +2

    Fantastic tutorial! Thank you very much.

  • @ashishsharma__
    @ashishsharma__ Рік тому +6

    I'm struggling with figuring out how to use this next auth with a external backend server with refresh token and access toke.
    Because as u use next auth it automatically changes your cookies names and their values, so u can't verify the cookie on the backend server.
    Can you make a video on that?

    • @Cannn414
      @Cannn414 Рік тому +1

      Yea, you add to the next auth cookie your backend API token and you're good. :)

    • @goddessworshipper
      @goddessworshipper 11 місяців тому +1

      Yes, would be great to have additional tutorial on how to:
      1) refresh your access_token with refresh token
      2) make sure access_token (jwt) and next-auth session expiration time are in sync with eachother (using next-auth callbacks)
      3) how to get the access_token out of the jwt (again using callbacks) and whether or not it's a good idea to make the access_token available to the Client (I'm assuming that's a pattern many sites use, but with Next.js 13+ with React Server Components I'm assuming that its best to keep the access_token (aka jwt) on the Server only.

  • @Flo-lq3gq
    @Flo-lq3gq 8 місяців тому

    This is solid gold, thank you!!

  • @rafaelwillen1796
    @rafaelwillen1796 Рік тому +5

    It would be nice if you explained how to use Next Auth with an external Backend with JWT

  • @diogoribeiro868
    @diogoribeiro868 Рік тому +10

    Can you make a video adding nextauth context to trpc? In your last video you had trpc and drizzle, can you make one with trpc,drizzle, nextauth?

    • @jakobgarde6769
      @jakobgarde6769 Рік тому

      Yeah, that would be awesome!!

    • @rahu1gg
      @rahu1gg Рік тому +2

      create-t3-turbo has already done that but it is not compatible with the API calls inside the rsc 😢

    • @MrBrandenS
      @MrBrandenS Рік тому

      Also been trying to sort this out. The auth approach is different if you are rolling server vs client. It's not as simple as it could be that's for sure.

    • @RegalWK
      @RegalWK Рік тому

      or supabase auth would be awesome too

  • @margosdesarian
    @margosdesarian Рік тому +1

    Another great vid!

  • @hamidmohamadi2943
    @hamidmohamadi2943 10 місяців тому +1

    You are awsome Jack, Thanks

  • @vasiloconnell281
    @vasiloconnell281 10 місяців тому +1

    Great stuff. Thank you very much!

  • @ccouto2869
    @ccouto2869 Рік тому

    The teaching really excellent, congratulations, I just think a protected page is unnecessary, it makes more sense to use middleware

  • @Mojiandfriend
    @Mojiandfriend Рік тому

    wow this video makes it so easy to understand.

  • @rayhanislam7518
    @rayhanislam7518 Рік тому +2

    Hey Jack, would you show a tutorial without next-auth how to do projected route? like as custom login system with external API

    • @jherr
      @jherr  Рік тому +1

      You mean like Clerk or auth0 or something?

  • @oliverkidd5160
    @oliverkidd5160 Рік тому +2

    Great video. Would be interested to see your take on performance with getServerSession? In current Nextjs builds it prevents any SSG and so leads to incredibly long ttfb. Any workaround beyond client side redirects? 🤔

  • @creativecoding5348
    @creativecoding5348 Рік тому

    i love the way u explain me and i love to see more educational videos thank you so much and have a great day

  • @elsaman
    @elsaman 8 місяців тому

    Looking forward to see version two of this video where you guys use the new beta of next-auth v5.0 😀

    • @jherr
      @jherr  8 місяців тому

      I wish it was "you guys", it's just me. ;)

    • @elsaman
      @elsaman 7 місяців тому

      @@jherr you're kidding !

  • @mulusewsimeneh5673
    @mulusewsimeneh5673 10 місяців тому

    Thank you very much! Exactly what I wanted

  • @1MrGerman
    @1MrGerman Рік тому +1

    You are the best, man!

  • @fhkodama
    @fhkodama Рік тому

    You are awesome! Thanks for teaching me so much! :)

  • @thatsTrudeau
    @thatsTrudeau Рік тому

    Thank you Jack. Hey on the Server Actions part. I have everything verbatim what you have, however, when I test this in the browser and click the Server Action Button I only get "Who Am I" and not the div with "You are {name}". I don't see any errors in the console when inspecting the page and everything seems to compile. Any ideas? Thanks in advanced for the help.
    ***UPDATE***
    After sleeping and taking a break, I rewatched this part........ attention to detail is important. It does work but I didn't realize that we actually created a button with the text itself. Once I clicked on the Who Am I? text, the attention to detail part, everthing worked. Thank you for your work and putting stuff like this out there.

  • @waltervanwoudenberg6876
    @waltervanwoudenberg6876 Рік тому

    Monorepo with nextjs + nestjs using drizzle and next-auth with the drizzle adapter would be cool video to watch. Where both next and nest use/share this drizzle db

  • @amirglx2028
    @amirglx2028 10 місяців тому +1

    thank you dude you saved my life

  • @faizanahmed9304
    @faizanahmed9304 Рік тому +2

    Thank you Jack sir, much needed video. what if we need to add multiple protected routes? I mean should we use here route groups?

    • @jherr
      @jherr  Рік тому +3

      Put the check in a shared layout.

  • @brikka
    @brikka 10 місяців тому

    Hey Jack! Thanks for the tutorial, appreciate the time you took to teach us. Love the compact teaching style. Just one thing, I had to use /pages/api/auth/[...nextauth].ts as I was getting an error when building the server. Also, I had to update the export at the bottom of the file to export default NextAuth(authOptions)

  • @tillidie4889
    @tillidie4889 9 місяців тому +1

    You saved me. I love you.

  • @chungleee
    @chungleee Рік тому +1

    thanks for the video - although i believe in not reinventing the wheel, i'm interested in knowing / learning how to implement all this without the already done package....if someone could point me to the right direction 🙏

  • @blindsider409
    @blindsider409 Рік тому +2

    Awesome video!
    Can you cover how to use next auth with bearer tokens. And is it possible to style the component of the provider?

  • @Knl-t8f
    @Knl-t8f 5 місяців тому +1

    Jack the tutorial slayer

  • @FamilyGuyVids11
    @FamilyGuyVids11 4 місяці тому

    I'd like to see a video that uses next-auth for email authentication and shows how best to handle JWTs using a refresh token in NextJS middleware so you're not hitting your database on every request to validate the session.

  • @dan503
    @dan503 3 місяці тому

    Note that "[...nextauth]" needs to be all lowercase. If you write "[...nextAuth]" it causes an error.

  • @jasonli622
    @jasonli622 4 місяці тому

    detailed, much appreciated !

  • @hqasmei
    @hqasmei Рік тому +1

    Hi Jack, great video and explanation like always. Wanted to ask can we how would you use middleware with NextAuth for protected routes? I'd imagine you would what to do that session check in all protected routes.

    • @jherr
      @jherr  Рік тому +1

      Yep That's another very valid strategy for protected routes.

  • @ez_krk
    @ez_krk 9 місяців тому +1

    and some bros are doing it to clean the streets for good, W

  • @sharewithamar
    @sharewithamar 3 місяці тому

    Hey Jack ! When you are launching your course ? Been awaiting for a long time :)

    • @jherr
      @jherr  3 місяці тому

      Just doing final reviews on it now. Really excited to finally get it out!

  • @williamdevonshire356
    @williamdevonshire356 Рік тому

    Great vid thanks :)
    My only criticism is that the jump cut edits where theres no code and then all of a sudden all the code, is a bit too abrupt, and makes it a bit hard to follow what you did in the immediate jump with all the new code.

  • @shadow_aya
    @shadow_aya Рік тому

    Really nice video, appreciate it!

  • @zamirza1
    @zamirza1 Рік тому +1

    Awesome video - I have a quick question. By converting the SessionProvider into a client component and placing it in the layout - doesn' t this mean that all other components by default become client components? To avoid this I instead implemented the middleware pattern which would still allow me to use server components.

    • @jherr
      @jherr  Рік тому +2

      Client components can take RSCs as children and they are still RSCs. Client components cannot _invoke_ RSCs. But they can take them as children. So you didn't need the middleware. Also, to get the user identity on the client you need the provider.

    • @zamirza1
      @zamirza1 Рік тому

      @@jherr thanks for clearing this up!

  • @mrx4532
    @mrx4532 2 місяці тому

    Thanks alot for this video :D, It was very helpful

  • @AlexanderTeno
    @AlexanderTeno Рік тому +2

    Love your videos, but today's thumbnail looks like it says, "App Router 5, Auth In Minutes" but it looks like it's meant to read "App Router, Auth In 5 Minutes"

  • @soytxemaleon
    @soytxemaleon Рік тому

    While this is great, I think putting everything under session provider which is a client component, makes everything under it being loaded with JavaScript, instead of coming in the html from the server, which I think -but I’m not sure- that is worse than having it right under a server component

  • @MilosJovancevic
    @MilosJovancevic Рік тому +1

    It would be awesome if you could show auth0 authentication but using their login screen. Also add sign out method etc cuz it’s not available out of the box. Graphql would be super awesome to include.

  • @afsanazamannipa7711
    @afsanazamannipa7711 11 місяців тому +1

    Great Tutorial. Thanks

  • @kamrant8915
    @kamrant8915 6 місяців тому

    Thanks a lot. Perfect like ever.

  • @mamlzy
    @mamlzy Рік тому +1

    Thank you so much Jack!

  • @ceotcr
    @ceotcr 10 місяців тому +1

    Best tutorial