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...
I've been struggling with this all day, what a lifesaver. Thank you!
Happy it helped!
Great video. I hope to see more supabase content in the future
THANK YOU THANK YOU THANK YOU ... All my other tutorials are now obsolete ... geeeze
Happy it helped!
Thank you, after going crazy with middleware usage in firebase I have decided to change to supabase
why isn't there error handling in the login page? The user should know when a user is registered or the credentials are wrong
This guide was helped me understand SSR really well. i was able to transition to SSR now
Happy it helped!
i followed evrything exactly as it is, it worked on the first sign up but after trying again it says error.
help!!
What does the error message say?
@@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
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
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.
This approach really works well. Thanks.
Hi Ryan, I love your videos! Very neat and easy to understand. Please, do more typescript. Saludos!
This video is crazy good. Love the effort.
Thank you. Really appreciate it
totally awesome. thanks for doing this
Muchas gracias amigo... de verdad super útil este video... sigue ilustrándonos en Supabase y Next
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?
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
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?
thank you, mr. keanu reeves!!
Haha you’re welcome
that theme hurts my eyyes
yeah default vs code theme is awesome
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. 😅
Great video! Thank you!
thanks for the video !
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?
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??
I have some errors when I click on confirmation email link it's redirect me to a page which is not found.
Thank you Ryan
thanks you, ! Great video
Don't need this, just came to like as you deserve it
Thank you, I appreciate that
Hopefully this help me I had challenge on how to setup the auth.
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?
Is it possible to protect a route through middleware?
Where the middleware handles both refreshing sessions and protecting routes.
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.
Can I use this along with Prisma?
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!