Next.js: Authentication (Best Practices for Server Components, Actions, Middleware)

Поділитися
Вставка
  • Опубліковано 20 лип 2024
  • Best practices for authentication in Modern Next.js and React: Server Components, Server Actions, Middleware.
    Docs: rc.nextjs.org/docs/app/buildi...
    Code: github.com/vercel-labs/app-ro...
    00:00 Intro
    00:25 Forms and Server Actions
    00:51 Form validation
    01:06 useActionState
    01:45 Creating a user
    02:14 Session management
    04:13 Authorization
    04:37 Middleware
    05:33 Data Access Layer
    07:35 API Minimization
    08:03 Data Transfer Objects
    09:45 Server Actions
    10:19 Conditional Rendering
    10:50 Client Context Providers
    11:14 Summary

КОМЕНТАРІ • 341

  • @arbizen
    @arbizen Місяць тому +22

    Your voice is healing. I can watch it all day.

  • @niloyrudra7905
    @niloyrudra7905 Місяць тому +9

    Very concise and to the point approach makes this short tour to auth a memorable one. Thank you. 👏

  • @lucasfontesgaspareto
    @lucasfontesgaspareto 17 днів тому +1

    The vibe of this video brings a lot of peace, I really liked it, congratulations on the content 😁

  • @victormayowa7989
    @victormayowa7989 Місяць тому +2

    Your smile is relaxing and refreshing. You made the tutorial seems simple

  • @oskrm
    @oskrm Місяць тому +12

    Video quality is top-notch, great job!

  • @klaudiuszbiegacz3519
    @klaudiuszbiegacz3519 Місяць тому +3

    I'm amazed by the quality of the video, please do more stuff like this :)

  • @TheSteelzeh
    @TheSteelzeh 15 днів тому +1

    Amazing video, no bs, no fluff straight to the point and no spoon-feeding thanks!

  • @elhadi9886
    @elhadi9886 26 днів тому +16

    Honestly, this is the clearest tutorial I have ever seen. Continue with this method; it works well.

  • @vijaysarathy3937
    @vijaysarathy3937 17 днів тому

    This is useful, high quality content that is executed professionally. Clearly this took a lot of work. Love the format and look forward to watching the rest of the series. Kudos!

  • @danielugbeye2545
    @danielugbeye2545 Місяць тому +1

    Your explanation on this topic is the best i have come across, and I absolutely love the meditation sound

  • @RonnieDenzel
    @RonnieDenzel Місяць тому +4

    Such a complex topic yet its explained with ease, thanks for this💯

  • @vedanshbisht1309
    @vedanshbisht1309 27 днів тому

    Just a minute in and i am appreciating the amount of research and sweat that went into editing this. Beautiful way of animating code. :D

  • @BrunoOliveira-tj5xw
    @BrunoOliveira-tj5xw Місяць тому +9

    What a professional tutorial. Can you show us how you made it? The progression of the code on the screen is perfect.

  • @rayyanalam4815
    @rayyanalam4815 Місяць тому +3

    This was such a complex topic, and yet you explained it with such simplicity. >>

  • @Pixelaze
    @Pixelaze 7 днів тому

    I had no idea that the quality of this tutorial would be this high before I clicked on this. Great video!

  • @David-Codes
    @David-Codes Місяць тому +12

    I was literally struggling with this yesterday LOL thanks

  • @tanmaykumar9277
    @tanmaykumar9277 24 дні тому

    I have seen you while learning to make dashboard-app 😄
    That documentation in Next-JS is so good, I learnt a lot from it!

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

    Being new to NextJS I appreciate your video. It is possibly one of the best videos I have seen. Great work and thank you!

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

      Appreciate it, welcome. Let us know if you have any feedback.

  • @MariaEduardaP.deAlmeida
    @MariaEduardaP.deAlmeida Місяць тому

    Incredible content, straightforward and didactic! Thank you

  • @joserubenildodasilva1899
    @joserubenildodasilva1899 Місяць тому +1

    Wow! Congratulations Delba.

  • @abravictech
    @abravictech 11 днів тому +1

    crisp Clear & Perfect .. Thank You

  • @curtjay
    @curtjay Місяць тому +1

    Fantastic video. Would love to see more videos like this discussing best practices

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

      That's the plan!

  • @ZiaCodes
    @ZiaCodes Місяць тому +3

    Really like the simplicity in the video... Relaxing video!
    I would love to see some advance patterns to build real world apps.

    • @Delba
      @Delba  Місяць тому +1

      Glad to hear it.
      I plan to 🙏

  • @alwinkc2197
    @alwinkc2197 Місяць тому +1

    You’r videos are top notch, please keep uploading

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

    As always a top-notch content from Delba

  • @nicolasmayorga8288
    @nicolasmayorga8288 6 днів тому

    Just discovered you and wow, amazing, really good information, concise, your voice it's amazing, and you have such a knowledge, thanks for sharing.

    • @Delba
      @Delba  4 дні тому

      Thank you 🙏

  • @dannx3144
    @dannx3144 11 днів тому

    This is the most perfect tutorial video!! Thank u sm!

  • @mooreedit
    @mooreedit 13 днів тому

    your name defines your videos. they are so calming and its good for learning

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

    Ngl this has been one of the most consise and informative NextJs video that i've ever seen.

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

      Kind of you to say, appreciate it!

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

    This is so elegant & perfect, keep up the good work! subbed!

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

      Thanks, welcome!

  • @phamtienthinh1795
    @phamtienthinh1795 7 днів тому

    Really Really REALLY informative, thank you for making the video

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

    Great video Delba, thanks so much, it's just what I need right now. 🙌🏻

  • @medamine44100
    @medamine44100 Місяць тому +42

    If there was an award for the video of the year in tech, I would vote on this one.
    Really quality content.

    • @Delba
      @Delba  Місяць тому +3

      Wow, thank you!

    • @user-ho1sc3hf8c
      @user-ho1sc3hf8c Місяць тому

      @@Delba How do you create your videos?

  • @İbrahimNikbay
    @İbrahimNikbay 20 днів тому

    Быстро нашли новую связку, молодцы, ну а я с вами всегда в профите!

  • @grimquokka9843
    @grimquokka9843 Місяць тому +2

    Very well explained, thanks for sharing with us.

  • @jasonwhittaker3940
    @jasonwhittaker3940 17 днів тому

    Brilliant tutorial best explained auth one I've come across

  • @deshmukhsomesh7306
    @deshmukhsomesh7306 7 днів тому

    this one is good , will need more videos like this

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

    Thank you for this video. You covered the topic of authentication very nicely to a beginner and it was clear and concise

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

      Awesome, great to hear!

  • @romanyfayiez3829
    @romanyfayiez3829 6 днів тому

    Thank you for this great and quick video, really helpful

    • @Delba
      @Delba  4 дні тому

      You're welcome!

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

    Thank you very much for sharing such a useful resource!
    BTW the animations and look and feel are top notch

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

      Glad to hear it!

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

    Sempre que eu vejo um vídeo já pulo aqui, a qualidade ta absurda

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

      obrigada meus amores brasileiros 🇧🇷

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

    Love the content!!! Right when I needed it! Thanks Delba!

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

      Glad to hear it!

  • @frankomartinez1686
    @frankomartinez1686 Місяць тому +1

    Thank you for your content, it's always very useful. 🙏

  • @brandincanfield4039
    @brandincanfield4039 8 днів тому

    This is a great video 👏👏👏👏👏
    I do have a hard time using server forms… but for login it’s fine. Thanks for the vid

  • @temitopedavid9508
    @temitopedavid9508 Місяць тому +2

    Thanks alot i literally was looking for this

  • @user-yp2ii5gl1p
    @user-yp2ii5gl1p 29 днів тому

    Nice format, the best on Yt, thank y - pls keep going...✨

  • @rangerboi9715
    @rangerboi9715 Місяць тому +3

    Great content as always

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

    a real gem ✨ of information and presentation! thank you a lot Delba for this remarkable video!

    • @Delba
      @Delba  Місяць тому +1

      Appreciate it!

  • @tawhidkhondakar731
    @tawhidkhondakar731 Місяць тому +1

    It was very very helpful. Thank you so much

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

    Hi Delba, please bring such content regularly, it really helps😄

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

      Glad to hear it, that's the plan!

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

    Muito bom o vídeo, salvou meu dia, estava com um bug usando next-auth e quebrando a cabeça, consegui adaptar a sua solução.
    Thanks a lot, you're Rock.
    I like a lot your contents.

    • @Delba
      @Delba  Місяць тому +1

      Feliz em ouvir

  • @m.waseem6616
    @m.waseem6616 Місяць тому +1

    hats off 👌.
    great explaination.

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

    The cutest person making tutorials

  • @ahmedhemdan707
    @ahmedhemdan707 Місяць тому +1

    thanks for the video really simple and professional

  • @candidodmv
    @candidodmv 10 днів тому

    Very nice explanation, good video quality and sound , but I feel that the environment is more darker than usual. But the rest great. Excited to the Next ones.

  • @amershboul9107
    @amershboul9107 Місяць тому +1

    Omg! It was very smooth
    Thank you!

  • @aqabyebye
    @aqabyebye Місяць тому +1

    Insane editing!

  • @codewithguillaume
    @codewithguillaume Місяць тому +3

    Very nice thanks Delba :)

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

      Cheers Guillaume!

  • @houseofdragons9764
    @houseofdragons9764 Місяць тому +1

    Life saver, thank you so much for this

  • @shreyashraj
    @shreyashraj 17 днів тому

    A great video. Loved your voice.

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

    I will definitely creating this theme extension for VS Code, I really like the colours and the dark background. It is quite minimalistic.

  • @houseofcoding101
    @houseofcoding101 15 днів тому

    Please make more quality videos. Really liked your content. Thanks

  • @edan626
    @edan626 3 дні тому

    Great explanation

  • @code-e-jahan
    @code-e-jahan 16 днів тому +7

    that felt like an Ai , but that was the shortest and the clearest auth explanation I ever saw

  • @user-zn3fg1eg4m
    @user-zn3fg1eg4m Місяць тому

    Really a clear and understanding video it will be more great if it includes window authentication too as a single sign-in

  • @prashlovessamosa
    @prashlovessamosa Місяць тому +2

    Thnx for sharing miss Delba

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

    i didn't saw your whole video. i just saw you and subscribed.

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

    I like it and I subscribe. I love the way and the effort you put into making this video.

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

      Welcome!

  • @dreamcode869
    @dreamcode869 Місяць тому +1

    Thanks for your awesome explaintion

  • @hombingdairi
    @hombingdairi 21 день тому

    Связка просто имба!

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

    this video is a life saver. Thanks a lot !

  • @headshotmaster3401
    @headshotmaster3401 9 днів тому

    Amazing tutorial, but I am sure 50k people are here for your voice and the 8k for nextjs :D

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

    Thank you so much. You explained very well.
    Please keep creating tutorial like that. Thank you mam

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

    Delba beauty with brain ❤. Love your content always

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

    I’m gunna keep building in nextjs just so I can watch your videos 😂

  • @endlessia
    @endlessia Місяць тому +1

    Thank you so much for this video, it’s very clear & simple to understand with server actions now! 😊
    (btw what tools are you using for such an incredible video)

    • @Delba
      @Delba  Місяць тому +1

      Glad to hear it.
      I used Remotion.

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

    amazing video Delba 😄

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

    You and Lee need a raise 😊😊

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

      Haha thanks!

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

    It used to be simple, there was clear separation between what run on server, what count as react component, especially serversideprop, used to love that. Now you need to 'mark' which file runs where, even when you used it on a react component, otherwise it'll be marked as server-side and gave you error DURING BUILD, and not while coding. Beautiful.

    • @Delba
      @Delba  Місяць тому +1

      There is a challenge of demarkation when you use the same component model and language on the client and server, however we believe the composability and shareability is worth it.
      You should be getting errors during development by the way, can you share an example of something only erroring in build? Perhaps we can fix it.

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

    Good job Delba!!!

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

    Well done. Just, well done.

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

    Need someone like her in my life

  • @saddamhussainEscap
    @saddamhussainEscap 27 днів тому

    you have very friendly style explanation but you are doing it quickly
    so i need to rerunning the video many times to get the idea 😅😅

  • @admggm
    @admggm 14 днів тому

    good, a follow up video with social login would be amazing!

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

    Amazing quality and to the point content.
    Just curious what combination of tools and softwares are you using for the code animations and transitions?

  • @ArmandoPineda4
    @ArmandoPineda4 27 днів тому

    ¡Muchas gracias!

  • @nayanjaiswal
    @nayanjaiswal 23 дні тому

    Amazing 👍

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

    i love this video! thank you

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

    Very nice! ASMR coding with Delba hahah

  • @sawos1596
    @sawos1596 Місяць тому +11

    I really enjoyed your video on. It's rare to find tutorials that avoid third-party libraries, and yours made everything so easy to understand. Thanks for sharing your knowledge!

    • @Delba
      @Delba  Місяць тому +1

      Thank you for saying so.

    • @rand0mtv660
      @rand0mtv660 Місяць тому +3

      Yeah the extreme reliance on 3rd party services to do anything in tutorials is alarming really. People should learn the basics and then use services if they need to because they will then understand what those services provide and what problems they solve for them, if any.

  • @csguru8211
    @csguru8211 Місяць тому +2

    Oh my god. After watching your video I thought even the documentation on vercel does not explain the things the way you did ao sweetly. Then I subscribed your channel and started exploring your channel and found out that you work at vercel. The way you explained things in calm and sweet voice with smile it was just way way more digestable than any other video or documentation. Thankyou. You deserve to be at vercel. And if possible please make more videos explaining how nextJS works.

    • @PhilipAlexanderHassialis
      @PhilipAlexanderHassialis 27 днів тому

      In general documentation on next-auth are utterly atrocious. Many things (like e.g. clearing the client cookies on logout, or how to read them, the whole bruhaha with RSC while using next-auth v4 and so on) are either not entirely clear or "exercise left to the reader".
      Take this video for example: authentication *without* using next-auth - because at least this way you get to have some agency on what actually happens as you login/navigate in the application.

  • @francis.lagares
    @francis.lagares Місяць тому

    You should definitely make a whole Next.js course ! 😀

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

      I'll be making more Next.js content atleast.

  • @ciphore
    @ciphore Місяць тому +1

    Great reference thnx

  • @godswillumukoro8908
    @godswillumukoro8908 Місяць тому +1

    No. 1 NextJS Content Creator. Thanks for making this Delba!

  • @skydomeblue
    @skydomeblue 26 днів тому +1

    amazing

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

    Great share 😊🙌

  • @PhilipAlexanderHassialis
    @PhilipAlexanderHassialis 27 днів тому

    Excellent video! Is there a chance that there is a github branch with the Providers paradigm? I really want to examine this particular pattern, since, after all, Context is a client thing and (theoretically) you can't have server components "inside" client components. I would love to see Next's approach on this (perhaps using internally ServerContext or something more interesting/exotic?).
    Thanks all in all, a very thorough run-down on what's what on the somewhat thorny authentication/authorisation subject!

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

    I love your voice 😭❤️

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

    really fascinating explaining and the animations were superb, can you show how you made them?

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

      Thanks, I use a tool called Remotion.

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

    The moment the food arrived was the moment of victory (It was funny haha)