Problem with RLS

I have created a RLS Policy which allows the user to insert data into an table. When trying it over the Supabase JS Client, it always says „new row violates rls policys for table ‚…‘“. But when doing it inside the Supabase Website by impersonating the user everythings works fine.
2 Replies
garyaustin
garyaustin2mo ago
Do you have .select() on the insert call? If so you also need to meet the select policy. Otherwise seems like you don't have a user session when you make the call from the client. You can check by looking for the role in the API Gateway log. What is your policy?
WolfsCoding
WolfsCodingOP2mo ago
OMG!!! I spent the howl day thinking why it wouldn't work. And after 6 hours of debugging and frustration i saw i imported the supabase client form @/supabase/client and not @/supabase/server...

Did you find this page helpful?