From b8707817b6b982b44ac25bce9ea25798626831e6 Mon Sep 17 00:00:00 2001 From: RilDev Date: Thu, 18 Jan 2024 13:22:17 +0100 Subject: [PATCH] fix: add bearer token to resumable-upload-uppy example (#18789) --- examples/storage/resumable-upload-uppy/README.md | 1 + examples/storage/resumable-upload-uppy/index.html | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/storage/resumable-upload-uppy/README.md b/examples/storage/resumable-upload-uppy/README.md index bbf4c94a6e4..7d8f2d31420 100644 --- a/examples/storage/resumable-upload-uppy/README.md +++ b/examples/storage/resumable-upload-uppy/README.md @@ -13,6 +13,7 @@ This example shows how to use [Supabase Storage](https://supabase.io/docs/refere const SUPABASE_ANON_KEY = '' // your project's anon key const SUPABASE_PROJECT_ID = '' // your project ref const STORAGE_BUCKET = '' // your storage bucket name +const BEARER_TOKEN = '' // your bearer token ``` Serve the index.html file locally (e.g. with Python Simple HTTP Server) and start uploading: diff --git a/examples/storage/resumable-upload-uppy/index.html b/examples/storage/resumable-upload-uppy/index.html index 450ec4da0b2..437a7885819 100644 --- a/examples/storage/resumable-upload-uppy/index.html +++ b/examples/storage/resumable-upload-uppy/index.html @@ -44,9 +44,10 @@ Tus, } from 'https://releases.transloadit.com/uppy/v3.6.1/uppy.min.mjs' - const SUPABASE_ANON_KEY = 'repace-with-your-anon-key' - const SUPABASE_PROJECT_ID = 'repace-with-your-project-id' - const STORAGE_BUCKET = 'repace-with-your-bucket-id' + const SUPABASE_ANON_KEY = 'replace-with-your-anon-key' + const SUPABASE_PROJECT_ID = 'replace-with-your-project-id' + const STORAGE_BUCKET = 'replace-with-your-bucket-id' + const BEARER_TOKEN='replace-with-your-bearer-token' const folder = '' const supabaseStorageURL = `https://${SUPABASE_PROJECT_ID}.supabase.co/storage/v1/upload/resumable` @@ -61,7 +62,7 @@ .use(Tus, { endpoint: supabaseStorageURL, headers: { - authorization: `Bearer ${SUPABASE_ANON_KEY}`, + authorization: `Bearer ${BEARER_TOKEN}`, apikey: SUPABASE_ANON_KEY, }, uploadDataDuringCreation: true,