supabase / storage-js

JS Client library to interact with Supabase Storage
Apache License 2.0
130 stars 39 forks source link

Storage .list() method not seem to be working #111

Open thesyedbasim opened 2 years ago

thesyedbasim commented 2 years ago

Bug report

Describe the bug

The .list() method in supabase.storage.from('') is not seem to be working.

To Reproduce

You can copy this snippet and add it to your code which is connected to supabase.

const { data, error } = await supabase.storage
    .from('images')
    .list(`products/${productId}`);

if (error) {
    console.error(error);
}

Expected behavior

List of all images should be returned.

System information

inian commented 2 years ago

Hey @thesyedbasim, by default storage buckets are private and have RLS turned on. If you want to list objects from the bucket, the user must have the appropriate read policy attached or use the service role key to completely bypass access control for the bucket.