Тёмный
No video :(

How to Use SUPABASE AUTH With Next.js 14 

Cole Blender 🇺🇸
Подписаться 21 тыс.
Просмотров 20 тыс.
50% 1

Here's an easy guide for setting up and using Supabase Auth with Next.js 14
Subscribe 👉 / @coleblender
My personal website 👉 coleblender.com
My business website 👉 superlativesit...
GitHub 👉 github.com/Col...
X 👉 / coleblender
IG 👉 / yazzibelani
LinkedIn 👉 / cole-blender
GitHub Repo 👉 github.com/Col...

Опубликовано:

 

17 мар 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 37   
@netTraverser
@netTraverser 3 месяца назад
It's not clear why the getUser function you defined in this video is different from the one in the createAccount and deleteAccount with middleware video. I'm confused about that part. It seems like my session isn't persisting so User always results in being null
@netTraverser
@netTraverser 3 месяца назад
Maybe this was a better comment for that video, but you get it.
@coleblender
@coleblender 3 месяца назад
I'm looking at the code for both videos right now. In the other video I have "if (!user) return null;" in the function because I usually add other code after that to fetch information about the user from the database. I should have taken that line out for that video because we don't deal with a database it's just auth. The other difference is that I pass in an argument to the getSupabaseAuth function in this video. Because I changed the getSupabaseAuth function to do a try catch the isComponent argument is unnecessary. If you have your code in a public GitHub repo I can look over it and try to see what's wrong.
@kamil_supabase_enjoyer
@kamil_supabase_enjoyer 4 месяца назад
Great!
@coleblender
@coleblender 4 месяца назад
Thank you! Let me know if you want me to cover any other topics
@kamil_supabase_enjoyer
@kamil_supabase_enjoyer 4 месяца назад
@@coleblender The only problem which I still have with Supabase is how to coordinate DEV, QA and PROD enviroments in sync
@coleblender
@coleblender 4 месяца назад
@@kamil_supabase_enjoyer what exactly do you mean? The only problem I have is that you have to configure the website url for auth which means I have to change it when working in dev but other than that I have no problems
@olivertimmons367
@olivertimmons367 16 дней назад
Love the video, One issue I have is that CookieMethods no longer exists inside supabase/srr package. Do you know of a work around or another way to solve this? Thanks
@coleblender
@coleblender 15 дней назад
If you look at the updated docs it has the new code that you need: supabase.com/docs/guides/auth/server-side/creating-a-client?queryGroups=environment&environment=server Which is this: import { createServerClient } from '@supabase/ssr' import { cookies } from 'next/headers' export function createClient() { const cookieStore = cookies() return createServerClient( process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, { cookies: { getAll() { return cookieStore.getAll() }, setAll(cookiesToSet) { try { cookiesToSet.forEach(({ name, value, options }) => cookieStore.set(name, value, options) ) } catch { // The `setAll` method was called from a Server Component. // This can be ignored if you have middleware refreshing // user sessions. } }, }, } ) } Is this what you're talking about?
@patricijo
@patricijo 4 месяца назад
Love your straightforward way without telling any bullshit! 12:45 seconds pure information
@coleblender
@coleblender 4 месяца назад
I’m glad you appreciate it! As someone who learned programming from RU-vid I know how annoying it is to sift through the bullshit. I will continue with this style
@pcv-free-as-a-bird
@pcv-free-as-a-bird Месяц назад
Hi there!! Thank you for the video it was really nice.. I’ve setup supabase/srr on my Remix js app. The createBroswerClient and createServerClient works!! But I still don’t understand the concept between when to use the Broswer Client or the Server Client.. I know that when it’s for front-end is the Broswer Client but I think I would need a real life example to understand both. Anyone can help me?
@coleblender
@coleblender Месяц назад
I actually just released a video covering this. It’s my most recent video
@coleblender
@coleblender Месяц назад
And I’m glad you liked it!
@pcv-free-as-a-bird
@pcv-free-as-a-bird Месяц назад
@@coleblender oh wow ok I just saw it!!! It’s very nice :D Thank you so much. I should release a video soon also covering this Supabase SSR using Remix JS. There is no enough video of Remix on RU-vid and I thinl that would help people. Thanks again!
@coleblender
@coleblender Месяц назад
@pcv-free-as-a-bird hell yeah bro that’s a great idea keep it up. FYI I do something slightly wrong with the client auth near the end so I’m releasing a video just about client auth on Monday
@pcv-free-as-a-bird
@pcv-free-as-a-bird Месяц назад
@@coleblender No problem. The only thing I need it’s to understand in which case we use BrowserClient and when we use the ServerClient. I’m still a bit confuse with both case scenarios. A real life example would be but I’ll check your most recent video and probably will get it. Thanks!
@quangminhtran7592
@quangminhtran7592 4 месяца назад
You are amazing! Thank you!
@coleblender
@coleblender 4 месяца назад
Hell yeah bro I got you!!
@hamzasaleem1537
@hamzasaleem1537 4 месяца назад
well fuck yeah! that's how you do tell things. 🙏
@hamzasaleem1537
@hamzasaleem1537 4 месяца назад
subscribed!
@coleblender
@coleblender 4 месяца назад
Hell yeah man appreciate it! I just released another video going a little more in depth. Check it out if you want to know how to manage users!
@hamzasaleem1537
@hamzasaleem1537 4 месяца назад
​@@coleblender i just watched it. i think i have a request, i want to see how you handle the forgot password thing with auth. because i have tried that previously and i always ran into issues with the redirect urls (even with supabase ssr)
@coleblender
@coleblender 4 месяца назад
@@hamzasaleem1537 Okay I can make another video soon. I'm gonna make one on oauth next then I can do that one later.
@hamzasaleem1537
@hamzasaleem1537 4 месяца назад
@@coleblender appreciate ya. looking forward to more cool videos too! 🤝
@broken_jail2506
@broken_jail2506 4 месяца назад
You should have done a vid on how to create a new user🥲 aswell …anyways thank you for this and if you can please reply my comment on how to create a new user it will be much appreciated. You just earned a follow❤️
@coleblender
@coleblender 4 месяца назад
Thanks I appreciate it!! Maybe I can make a part 2 where I create a user
@broken_jail2506
@broken_jail2506 4 месяца назад
@@coleblender thank you, how soon?😢
@coleblender
@coleblender 4 месяца назад
I’ll most likely have it done by either Monday or Tuesday
@coleblender
@coleblender 4 месяца назад
Btw I posted the new vid like a week ago
@broken_jail2506
@broken_jail2506 4 месяца назад
@@coleblender Oh really thank you i'll check it out now!
@netTraverser
@netTraverser 3 месяца назад
This is what i'm talking about . Good man Cole 🫡
@coleblender
@coleblender 3 месяца назад
Hell yeah man glad I could help 🍻
Далее
I forced EVERYONE to use Linux
22:59
Просмотров 335 тыс.
Sevinch Ismoilova - Xayollarim 18-Avgust 19:00 Premera
00:19
Don't Use Polly in .NET Directly. Use this instead!
14:58
SUPABASE OAuth With Next.js
20:16
Просмотров 2,6 тыс.
Set up Google OAuth with Next.js using Next-Auth!
21:00
The Big Headless CMS Lie (James Mikrut)
18:14
Просмотров 54 тыс.
The Greenwich Meridian is in the wrong place
25:07
Просмотров 709 тыс.
Easy setup next.js + supabase auth with my SupaAuth
9:39