In this video, I cover a new, updated guide for implementing authentication using Next.js and Supabase. Final Code: github.com/coderyansolomon/up... Supabase Docs: supabase.com/docs/guides/auth...
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 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. 😅
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.
@@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
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!