Тёмный
No video :(

Next.js Server Component role base access with Supabase 

Daily Web Coding
Подписаться 21 тыс.
Просмотров 16 тыс.
50% 1

In this video I am going to show you how to do Role base access with Supabase and Next.js Server Component.
Code
github.com/Che...
Doc and tutorial
- dev.to/sruhled...
- • Implement Authorizatio... ‪@Supabase‬
Support the channel : 🙏🌸
- donate 🌻: / dailywebcoding
Follow me: 👇
- Discord: / discord
- Github: github.com/Che...

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

 

25 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 47   
@DailyWebCoding
@DailyWebCoding 10 месяцев назад
I think supabase just updated the UI. right now you can do it in the sql editor and create the trigger from there by using this command. create trigger after insert on auth.users for each row execute function ();
@markbroomfield1818
@markbroomfield1818 10 месяцев назад
Apologises for being thick but could you tell me where I need to add this code? Thank you again for your help, Mark
@DailyWebCoding
@DailyWebCoding 10 месяцев назад
@@markbroomfield1818 In supabase dashboard sidebar. You can find SQL Editor. That's where you can run the code above
@markbroomfield1818
@markbroomfield1818 10 месяцев назад
@@DailyWebCoding Apologies, I understand it needs to be added to the SQL Editor. However, does it need to be attached to anything else or just a seperate code and run? Thanks Mark
@DailyWebCoding
@DailyWebCoding 10 месяцев назад
@@markbroomfield1818 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mcrqn77lUmM.htmlsi=GiVaHvcrioXb9bZY you can check this video. Hope is can help you
@markbroomfield1818
@markbroomfield1818 10 месяцев назад
@@DailyWebCoding Thank you so much for the quick work around on this. Works a treat, great channel and please keep up the amazing work. Thanks Mark
@FalconMasters
@FalconMasters 8 месяцев назад
There is one security problem with that aproach that you all guys have to be aware of. If you make a "user" or "profile" table where you store all the user info like, name, avatar, settings, etc and you store the role on that same table you have a security issue there. Because you will probably make a Row Level Security where you are going to allow users edit their own row in "user" table, therefore the user will have access to change his own role to "admin". To solve this you have to add the "role" column on a different table and that table should have a Row Level Security that only allows to read and not to write/update.
@guillermomarindavila5779
@guillermomarindavila5779 8 месяцев назад
gracias falcon, aprendi mucho de ti en un inicio y vaya sorpresa con el comentario, tienes razon!
@FalconMasters
@FalconMasters 8 месяцев назад
@@guillermomarindavila5779 Muchas gracias a ti por ver mis videos, me alegra que te sirvieran!
@eyyaaaaa
@eyyaaaaa Месяц назад
thnx
@codewithguillaume
@codewithguillaume Год назад
Amazing video :) Please continue !
@DailyWebCoding
@DailyWebCoding Год назад
Thank you ❤️
@kryptons-galaxy
@kryptons-galaxy 5 месяцев назад
Perfect tutorial, I was confused with managing the user accesses, this one cleared all the doubts, thanks ❤
@DailyWebCoding
@DailyWebCoding 5 месяцев назад
Glad it helped!
@superurgmail
@superurgmail 10 месяцев назад
Brilliant video - just what I needed. Thanks (and subscribed).
@cheninh1423
@cheninh1423 11 месяцев назад
so clearly. thank you
@giroda
@giroda 11 месяцев назад
nice video and nice line-height
@streamocu2929
@streamocu2929 Год назад
we want more... ❤ could you do supabase and stripe?
@DailyWebCoding
@DailyWebCoding Год назад
I will look into that. Thank you for your suggestion.
@automioai
@automioai Год назад
Yes! stripe-supa -next 13.4-jotai
@brianwalsh7040
@brianwalsh7040 Год назад
Great videos, thanks! Could you do one where anyone visiting the site can view the all the posts, but only an admin can update the posts that belong to them?
@DailyWebCoding
@DailyWebCoding Год назад
Thank you for your suggestion. I will try to do that.
@appstuff6565
@appstuff6565 11 месяцев назад
yes pleaSE ! @@DailyWebCoding
@Michael-Martell
@Michael-Martell Год назад
I think a regional manager with several managers with several teams. Managers should only see their teams… etc. I’ve been thinking about how to make this works for several years now as I have learned to code.
@raynosebastian6275
@raynosebastian6275 11 месяцев назад
hi a beginner here, why i cant choose the users from the trigger option right now ?
@DailyWebCoding
@DailyWebCoding 10 месяцев назад
I think supabase just updated the UI. right now you can do it in the sql editor and create the trigger from there by using this command. create trigger after insert on auth.users for each row execute function ();
@markbroomfield1818
@markbroomfield1818 11 месяцев назад
Hello, great tutorial 👍 ! Everything was going fine until when I needed to select the auth table (timestamp 06:23) in the trigger ui. Only my public tables were available and not anything else! Is there a reason why I can't make triggers from any of the locked shemas? Can you help. Thanks, Mark
@raynosebastian6275
@raynosebastian6275 11 месяцев назад
currently facing the same thing right now, did you find the solution?
@DailyWebCoding
@DailyWebCoding 10 месяцев назад
I think supabase just updated the UI. right now you can do it in the sql editor and create the trigger from there by using this command. create trigger after insert on auth.users for each row execute function ();
@user-dm5qi4nb6l
@user-dm5qi4nb6l 9 месяцев назад
Supabase has a roles column in auth.users I tried to use that but maybe that is not how it is supposed to be used maybe that's only there to be managed for supabase? I created a custom role give it to a user but then when I made the rule it was simply not working, of course I gave the user in auth.users that custom role but then I had to change it back to authenticated then update the rule and it worked normally.
@DailyWebCoding
@DailyWebCoding 9 месяцев назад
You can check my latest video about role management in supabase Build Role Access Dashboard with Next.js 14,Supabase, Shadcn,Tailwind ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-D7BzpvHM6JI.html
@ambicasupraja9651
@ambicasupraja9651 8 месяцев назад
i am getting this error while sign up AuthApiError: duplicate key value violates unique constraint "user_pkey" as i am created trigger from sql editor
@DeejayAlid
@DeejayAlid 10 месяцев назад
Are there any security flaws using this method?
@FalconMasters
@FalconMasters 8 месяцев назад
Yes, that if you make a row level security that allows the user to update his profile or user info and is on the same table as the rol then he has access to update his role and set it to "admin" giving him self permissions. One way to fix this is to have 2 diferent tables for the user, one for his data and other one for his role or permissions.
@angelluis5252
@angelluis5252 9 месяцев назад
nice video, i have a qustion, how can i change the role using params? i need create multiples roles
@DailyWebCoding
@DailyWebCoding 9 месяцев назад
Currently I am working on a new video about this as well. Stay tuned for that
@utomoyogafirmansyah7912
@utomoyogafirmansyah7912 Год назад
But how to set role while we signup not with supabase?
@rgorai1029
@rgorai1029 7 месяцев назад
I need this too 😭 did you ever figure it out?
@utomoyogafirmansyah7912
@utomoyogafirmansyah7912 7 месяцев назад
@@rgorai1029 yeah i make another table that containing userprofile and role and after signup an get token user need to set his role
@thisismedg
@thisismedg 7 месяцев назад
@@rgorai1029 me too
@loribryant4999
@loribryant4999 6 месяцев назад
sir can you create a react version of this please I dont understang nextJS
@loribryant4999
@loribryant4999 6 месяцев назад
hey bro can you updated this please I need this and the role please dont just put the role in it manuall make it dynamic, also please take it slow man you kind super fast
@DailyWebCoding
@DailyWebCoding 6 месяцев назад
Build Role Access Dashboard with Next.js 14,Supabase, Shadcn,Tailwind ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-D7BzpvHM6JI.html
@DailyWebCoding
@DailyWebCoding 6 месяцев назад
You can check this one
@loribryant4999
@loribryant4999 6 месяцев назад
@@DailyWebCoding thank you sir, are you able to create a video like this with reactJS alone please
@ahmedmusawir
@ahmedmusawir Месяц назад
Your head is covering code ... we really didn't need to see your face ... we just needed to see code which we couldn't for your head which makes this video useless ...
Далее
Wife habit 😂 #shorts
00:16
Просмотров 49 млн
Avaz Oxun - 10 yillik yubiley konsert dasturi 2023
2:52:33
Supabase and NextJS 14:  Auth and Server Actions
1:19:31
How to Manage User Roles in NextJS / NodeJS
12:11
Просмотров 108 тыс.
Supabase + Next.js ULTIMATE Auth Combo
8:55
Просмотров 3,7 тыс.
Complete Prisma & Supabase DB Tutorial
57:43
Просмотров 19 тыс.
You don't need Supabase Auth - use this instead!
7:30
Complete UPDATED Guide - Next.js Auth With Supabase
38:22