SupabaseS
Supabase6mo ago
Ise

Problem with Storage

This is my function to get the Signed Url of a file in the storage:
const signedUrl = useCallback(
async (download = false) => {
if (!file.storage_key) throw new Error('storage_key mancante');
const { data, error } = await supabase.storage
.from(BUCKET_NAME)
.createSignedUrl(file.storage_key, 60, { download });
if (error || !data?.signedUrl)
throw error ?? new Error('URL non trovato');
return data.signedUrl;
},
[file.storage_key, supabase]
);
When this function is executed i get this error:
materiali:1 Access to fetch at 'https://supabase.justware.it/storage/v1/object/sign/public-files/Corso%20SCRATCH.pdf' from origin 'https://justware.it' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

What is the problem?
Was this page helpful?