I’m trying to upload an image from the client to a supabase storage bucket that has RLS with the standard template selected
((bucket_id = 'images'::text) AND (( SELECT (auth.uid())::text AS uid)= (storage.foldername(name))[1]))
The code that uploads the image
const storagePath = ${user}/${noteId}/${nodeId}.png;
//upload the image to the storage
const {data, error} = await supabase.storage.from('images').upload(storagePath, Image, {cacheControl: '3600', upsert: false});
The problem is that I get the error new row violates row-level security policy
I tried to use the Service Role Key and with that it worked but using the normal key it doesn’t work because of the RLS and since I need to do it in the client I can’t use the service role key