Complete UPDATED Guide - Next.js Auth With Supabase

Поділитися
Вставка
  • Опубліковано 12 вер 2024
  • In this video, I cover a new, updated guide for implementing authentication using Next.js and Supabase.
    Final Code: github.com/cod...
    Supabase Docs: supabase.com/d...

КОМЕНТАРІ • 46

  • @jackkraus6948
    @jackkraus6948 3 місяці тому +8

    I've been struggling with this all day, what a lifesaver. Thank you!

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

      Happy it helped!

  • @michele8491
    @michele8491 4 місяці тому +3

    Great video. I hope to see more supabase content in the future

  • @ahmedmusawir
    @ahmedmusawir 2 місяці тому +2

    THANK YOU THANK YOU THANK YOU ... All my other tutorials are now obsolete ... geeeze

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

      Happy it helped!

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

    Thank you, after going crazy with middleware usage in firebase I have decided to change to supabase

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

    why isn't there error handling in the login page? The user should know when a user is registered or the credentials are wrong

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

    This guide was helped me understand SSR really well. i was able to transition to SSR now

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

      Happy it helped!

  • @kelvins.kumordzi3203
    @kelvins.kumordzi3203 2 місяці тому +2

    i followed evrything exactly as it is, it worked on the first sign up but after trying again it says error.
    help!!

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

      What does the error message say?

    • @kelvins.kumordzi3203
      @kelvins.kumordzi3203 2 місяці тому

      @@coderyan the error message says
      Uncaught (in promise) Error: Called encrypt() without a session key
      at SecretSession.encrypt (background.js:1:12029)
      at SecretSession.createSMSG (background.js:1:5665)
      at GetLoginNames4URL (background.js:1:36719)
      at background.js:1:39849

    • @rochie5273
      @rochie5273 28 днів тому +1

      Supabase has a cap on email requests per hour (the confirmation email). You can either setup an SMTP provider, or go into supabase settings and turn off email confirmation

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

    thanks Ryan for this instructive video. How would you handle admin users? Admin users should have access to the admin route, but regular users should not have access to the admin route.

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

    This approach really works well. Thanks.

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

    Hi Ryan, I love your videos! Very neat and easy to understand. Please, do more typescript. Saludos!

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

    This video is crazy good. Love the effort.

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

      Thank you. Really appreciate it

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

    totally awesome. thanks for doing this

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

    Muchas gracias amigo... de verdad super útil este video... sigue ilustrándonos en Supabase y Next

  • @diegoberistaindelamora6594
    @diegoberistaindelamora6594 19 днів тому

    The best and most actualized video, but i got a problem woth auth route, im using magic link but when i send the type and hash token it throw an error saying is expired or unavailable but why?

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

    Hi Ryan, your video are so cool. But, I confused about how to handle the error, like showing an error message when login or signup is failed? In your video, it will redirect to another page, but how to make it just stay in login or signup page with an error message. Thank you

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

    Thanks a lot for this video. However for my next project I have 2 different types of users, regular users and admin users. Only users with the 'admin' role should have access to the admin route. How should you implement that?

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

    thank you, mr. keanu reeves!!

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

      Haha you’re welcome

  • @xbozo.
    @xbozo. 4 місяці тому +5

    that theme hurts my eyyes

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

    I unintentionally trolled myself by making the raw_user_meta_data too big resulting in a split up cookie returned to me. I didn't realize what was going on until later on. Had to update my utils/supabase files to handle this edge case. 😅

  • @dan.stacy1
    @dan.stacy1 4 місяці тому

    Great video! Thank you!

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

    thanks for the video !

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

    How to send success/error toast from server actions?
    Do we need to return something from them and call the toast in the client component?

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

    Hey. Thank you so much for this video. How can I add oauth providers to the page (sign in with google, sign in with microsoft, all that fun stuff)? I used to use nextauth, do I still use that??

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

    I have some errors when I click on confirmation email link it's redirect me to a page which is not found.

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

    Thank you Ryan

  • @data-IndieHacker
    @data-IndieHacker 4 місяці тому

    thanks you, ! Great video

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

    Don't need this, just came to like as you deserve it

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

      Thank you, I appreciate that

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

    Hopefully this help me I had challenge on how to setup the auth.

  • @SizzleReel-wd4hq
    @SizzleReel-wd4hq 4 місяці тому

    Definitely use TypeScript going forward. Good practice and makes for better code, it's also redundant to copy the .ts file and then delete it?

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

    Is it possible to protect a route through middleware?
    Where the middleware handles both refreshing sessions and protecting routes.

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

      Was wondering this myself...but the supabase doc gives me the impression we should "not" rely on middleware for authentication, and instead use supabase.auth.getUser in pages, components, etc. So what I did, following this, was to create a (protected) folder, put all my protected app routes in it, then put the call to supabase.auth.getUser in a layout.tsx file inside the (protected) folder. Worked like a champ and only had to be coded in 1 place. The call to getUser is checking for a session on the supabase server, and avoids using getSession, which checks cookies, as noted by supabase doc.

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

    Can I use this along with Prisma?

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

    Thanks for the video, but supabase!!! Whaaat is this, using nextjs auth is easier now...we use supabase to make the auth process ez not to complecate it!