Hi sir, I've been on a pretty eclectic journey through the tech landscape, from diving deep into meditation and mindfulness to exploring the intricacies of data storytelling. Recently, I've been channeling my energy into becoming a more proficient founder, based out in the vibrant tech scene of Vancouver, Canada. Would you be interested in handling the auth process and onboarding logic for a new platform?
@@DailyWebCoding nothing to say, really, i like your videos, but i have a question about supabase if you wanna help me. i see that we have a client key and a service key which bypasses row level security. does that mean i can enable row level security and not set up any policies and then just use the service role key on the server? is this a valid/common approach?
@@jotaroisdarius1918 Not sure I understand completely. But service role key is for admin api only and it can not be use to insert to data table. supabase.com/docs/reference/javascript/admin-api
Thank you for great video. Could you, please, explain, how to use conditional rendering in 'use client' navbar, for example. How to listen in client component for supabase.auth status change?
Hey man thanks a lot for your tutorial, I really found it super useful! Could you please create a tutorial on how to call superbase server actions or api routes from client components to insert or fetch data from a supabase table? Thanks!!
who knows why i can't see result from SignIn or SignOut in the client side and can' tdisplay a toast, like in the server post does corectly, but nothing returned to rhe client?
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?
You added set cookies in server client but it says at 1:58 on the Supabase website NOTE Server Components only have read access to cookies. Trying to understand, why?
The reason that I used supabase server client to SET adnd REMOVE cookie is because my login implementation is in the server action. If I create supabase server client only read cookie only, I can't login and user will not have a session in the cookie. If we do authentication using client component, then we don't have to add SET or REMOVE.
Thank you for your tutorial. I want to retrieve a user's email to check if the email exists in the supabase before sending the reset password link to their email. How do I check the user's email without session?
for anyone getting this same error, you need to disable email confirmation on supabase dash, otherwise check if the response has any field pointing if the user its already created
Great video as always my friend 👍. Is there a way I can get the users to do item to render on say another page? So basically they are just updating other pages like adding a listing for non-users to see it. Hope this makes sense lol
Hey, thank you for the video! - I have subscribed! So my question is, how can we now do that: - user can log in and craete his own posts, and only he can edit them, but everyone can read them? - upload photots? Is it possible, would love to see a tutorial on that
Thank you so much for your dedication!! And I subscribed to your UA-cam channel. I have a question, how do you display an error in the bottom right corner of the browser?
We generally recommend using the new @supabase/ssr package instead of auth-helpers. @supabase/ssr takes the core concepts of the Auth Helpers package and makes them available to any server framework. Check out the migration doc to learn more. This is from supabase doc
The server.ts function to get the supabase client, doesn't the documentation state that server components can only READ cookies? Or am I misunderstanding. Thanks
The reason that I used supabase server client to SET adnd REMOVE cookie is because my login implementation is in the server action. If I create supabase server client only read cookie only, I can't login and user will not have a session in the cookie.
Could you make it possible to choose between admin and user in the registration form? In addition to that in the "dashboard" of the admin can modify the data of normal users and create "TODOs groups" where the user can register that group of "TODOs" and add a new one, how would it be something like that?
Hi. Thanks for the video. I tried to use another middleware (middleware chaining) to check for the user session using the server client but it always returns back null value. I use client auth for sign in and it does update the last sign in session on supabase. Please guide. Thanks.
@@DailyWebCoding I'm using createBrowserClient() for sign in. I wonder can I check for the session in the middleware? I tried get the session in the middleware (which I have already combined into 1 middleware file) but still it returns null. I did some investigation on the request and response outputs, I noticed something strange where when I change the cookies name to sb-localhost-auth-token, it works, but not during sb-[supabase project id]-auth-token
thanks for the video, grab code from github but i got some error while running npm run dev "failed to load SWC binary for win32/64" any suggestion? edit: it works idk why but suddenly work as well
Thank you so much, this helped me a lot ! I have one problem tho when i deploy to Vercel, page protection does't work properly, it seems after the iogging in, readUserSession returns null initially but if i remove the protection and try refreshing the protected page after logging in, session data is returned correctly. I don't have this problem on local btw, any ideas ?
Thank you for awesome tutorial. But is it working on Vercel production? (Local is completely working) Oauth is working but redirect is working difrrently only on production. redirect isnt work just get back with code token.
@@DailyWebCoding Thank you bro. I tried before but it doesn't work. But i figured out. I used same localhost:3000 at SiteURL. After I added 'mydomain/auth/callback' at Redirect URLs. Before I just added 'mydomain' That's why redirect wasn't work.
github.com/Chensokheng/next-14-supabase-ssr/tree/demo you can check here. If you have more question, you join my discord and ask more question as well.
Great video! Everything was explained clearly. However, I have a question: when I'm logging in, it is sending multiple tokens at once. After logging in twice, I have 107 authentication requests. Any ideas?
ua-cam.com/play/PLYHXTr4kGJjEPOZ_RqZG2uIguJCdA5ezT.html
if you faced issue, you can checkout my latest playlist on how to connect with supabase.
Hi sir,
I've been on a pretty eclectic journey through the tech landscape, from diving deep into meditation and mindfulness to exploring the intricacies of data storytelling. Recently, I've been channeling my energy into becoming a more proficient founder, based out in the vibrant tech scene of Vancouver, Canada.
Would you be interested in handling the auth process and onboarding logic for a new platform?
I had to go though a lot to find a solution for all the problems I had today, only for you to publish this hours later :(
I wish I had done this faster😁. Don’t forget to give me feedback or any suggestions that could improve this
@@DailyWebCoding nothing to say, really, i like your videos, but i have a question about supabase if you wanna help me.
i see that we have a client key and a service key which bypasses row level security.
does that mean i can enable row level security and not set up any policies and then just use the service role key on the server? is this a valid/common approach?
@@jotaroisdarius1918 Not sure I understand completely. But service role key is for admin api only and it can not be use to insert to data table. supabase.com/docs/reference/javascript/admin-api
Lol I'm the same stage 😂 u but luckily I found this video in time now imma watch whole n learn ❤
Thanks for the tutorial! I was struggling using the Supabase docs but you explained how to do just what I needed.
one small suggestion. we don't need to convert the response to sring then again convert it to json. we can do it directly
Perfectly explained. Congratulations!
If you have this "Error: Cookies can only be modified in a Server", you have to remove set and remove methods from the createServerClient funcion.
You really know what's going on with your code,I like that,now subscribed.
Thanks for the sub!
Thanks. This video is exactly what I Needed. Please make more Supabase videos
great stuff. If you have more protected routes than just /todo, i would move the session-check in the layout though.
Such a powerful and simple stack 🎉
GOAT
Thank you for this tutorial, you've saved my day 🙏
I get error after 1-2 hours: Error: Cookies can only be modified in a Server Action or Route Handler
Same mate, did you manage to resolve it ?
thanks for everything, please continue uploading content !
Great video. Thanks bro!
Thank you very much for this video!
Very Nice Video thanks bro 🔥
Thank you for great video. Could you, please, explain, how to use conditional rendering in 'use client' navbar, for example. How to listen in client component for supabase.auth status change?
ua-cam.com/video/KgK7m9zNHP4/v-deo.htmlsi=wz4E5O-Mj9Lct9kR you check this video here
Hey man thanks a lot for your tutorial, I really found it super useful! Could you please create a tutorial on how to call superbase server actions or api routes from client components to insert or fetch data from a supabase table? Thanks!!
Yes sure I will do that
who knows why i can't see result from SignIn or SignOut in the client side and can' tdisplay a toast, like in the server post does corectly, but nothing returned to rhe client?
If you still faced the issue you can join my discord. I can help you over there
you saved my life bro.
Thanks for share, It saves me a lot of time.
Very helpful tutorial for me!!
Thanks very much
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?
You added set cookies in server client but it says at 1:58 on the Supabase website
NOTE
Server Components only have read access to cookies.
Trying to understand, why?
The reason that I used supabase server client to SET adnd REMOVE cookie is because my login implementation is in the server action. If I create supabase server client only read cookie only, I can't login and user will not have a session in the cookie.
If we do authentication using client component, then we don't have to add SET or REMOVE.
Nice , thanks video
ขอบคุณมากนะจ้าาา
thank you
thanks bro
can you share with us a reset-password tutorial
Thank you
How to get the session and user data on the client side when we authenticate using server side?
9:18 You don't need to return the redirect function
Thank you for your tutorial.
I want to retrieve a user's email to check if the email exists in the supabase before sending the reset password link to their email. How do I check the user's email without session?
I'm getting a fetch failed error when registering new user. Does anyone know how to fix it?
thanks!!!
I cant get the error of the user is already register, is it maybe i need to look a previous video or something?
you need to disable confirm email
for anyone getting this same error, you need to disable email confirmation on supabase dash, otherwise check if the response has any field pointing if the user its already created
i'm using supa with clerk.. how can i get the token(from clerk) on the server side?
Great video as always my friend 👍. Is there a way I can get the users to do item to render on say another page? So basically they are just updating other pages like adding a listing for non-users to see it.
Hope this makes sense lol
Why not add page protection inside the middleware
Yep sure we can do it from middleware as well and in my case I just want to read session from page so I can use later on
Hi Thanks alot brother, for this amazing video. when is your next video? (:
Now I am editing my new video. Hopefully I finish it by today 😅
Hey, thank you for the video! - I have subscribed!
So my question is, how can we now do that:
- user can log in and craete his own posts, and only he can edit them, but everyone can read them?
- upload photots?
Is it possible, would love to see a tutorial on that
Yes I will check on this after I finish my next-e-commerce tutorial . Stay tune for that
Thank you so much for your dedication!! And I subscribed to your UA-cam channel.
I have a question, how do you display an error in the bottom right corner of the browser?
ui.shadcn.com/docs/components/toast you can use this one to toast error or any messages u want
@@DailyWebCoding Oops... I thought it was a library, but it turned out to be a toast message hahaha
Anybody know a fix for permission denied on schema public?
What's the setting you have used to create space between lines in vscode?
I set my line height to 40. You can go to setting search for line height and change the value.
is there any specific reason that you didn't use auth helpers for next.js
We generally recommend using the new @supabase/ssr package instead of auth-helpers. @supabase/ssr takes the core concepts of the Auth Helpers package and makes them available to any server framework. Check out the migration doc to learn more. This is from supabase doc
The server.ts function to get the supabase client, doesn't the documentation state that server components can only READ cookies? Or am I misunderstanding. Thanks
The reason that I used supabase server client to SET adnd REMOVE cookie is because my login implementation is in the server action. If I create supabase server client only read cookie only, I can't login and user will not have a session in the cookie.
Hi thank you for the video, I have a problem with OAuth with google is there a way to get the uid after logging in?
After login you can read it from the session.
Could you make it possible to choose between admin and user in the registration form? In addition to that in the "dashboard" of the admin can modify the data of normal users and create "TODOs groups" where the user can register that group of "TODOs" and add a new one, how would it be something like that?
Yes sure in my next video, I am doing something similar to this I will send more detail in discord 😊
Hi. Thanks for the video. I tried to use another middleware (middleware chaining) to check for the user session using the server client but it always returns back null value. I use client auth for sign in and it does update the last sign in session on supabase. Please guide. Thanks.
I am not sure next.js support this. Base on this documentation. We can have only one middleware. nextjs.org/docs/messages/nested-middleware
I’ll change to one middleware later and see how it works. Any guidance on why is the getSession() using supabase/ssr returns null value?
@@yeongjong9395 It shouldn't if the user is authenticate. just make sure the user is login
@@DailyWebCoding I'm using createBrowserClient() for sign in. I wonder can I check for the session in the middleware? I tried get the session in the middleware (which I have already combined into 1 middleware file) but still it returns null. I did some investigation on the request and response outputs, I noticed something strange where when I change the cookies name to sb-localhost-auth-token, it works, but not during sb-[supabase project id]-auth-token
@DailyWebCoding I had a silly mistake (wrong env variables) and is resolved now. Thanks.
Thanks for the tutorial! When i try to get user session my data return null {"session":null}
Oh I fixed it! Just turn off email Confirmation
@@bipboprobot thanks a lot, I was facing the same problem
10:48 Bootong🤣
Is there a way to have a listener to refresh a header component and display the user?
ua-cam.com/video/KgK7m9zNHP4/v-deo.html. I think this video may help you.
❤
thanks for the video, grab code from github but i got some error while running npm run dev "failed to load SWC binary for win32/64"
any suggestion?
edit: it works idk why but suddenly work as well
Thank you so much, this helped me a lot ! I have one problem tho when i deploy to Vercel, page protection does't work properly, it seems after the iogging in, readUserSession returns null initially but if i remove the protection and try refreshing the protected page after logging in, session data is returned correctly. I don't have this problem on local btw, any ideas ?
same problem here
Thank you for awesome tutorial. But is it working on Vercel production? (Local is completely working) Oauth is working but redirect is working difrrently only on production. redirect isnt work just get back with code token.
Thank you so much for your feedback. Regard to your issue, make sure you set SITE URL to your domain url. Hopefully this could solve your issue.
@@DailyWebCoding Thank you bro. I tried before but it doesn't work. But i figured out. I used same localhost:3000 at SiteURL. After I added 'mydomain/auth/callback' at Redirect URLs. Before I just added 'mydomain' That's why redirect wasn't work.
Can you provide final github code repository please?
github.com/Chensokheng/next-14-supabase-ssr/tree/demo you can check here.
If you have more question, you join my discord and ask more question as well.
31:28 why no store to the session??
I think i made a mistake here. We can remove it. Since supabase do not cache the request inside next.js
Great video! Everything was explained clearly. However, I have a question: when I'm logging in, it is sending multiple tokens at once. After logging in twice, I have 107 authentication requests. Any ideas?
I am not sure why sure at well. I have never faced this issue before.
Waste of time !
Not working even with the full branch withe the all information and the good database url
man, why do you use such a terrible font?
you talk too fast.
He's doing his best. No need for this :)
@@marciplan agree here and you could set the speed down yourself :)