supabase/storage-js

createSignedURL links respond with status 400. "message":"querystring should have required property 'token'"

webprismdevin opened this issue · 1 comments

Bug report

Describe the bug

getSignedUrl returns erroring link

when creating a signedUrl, the return url that responds with
{"statusCode":"400","error":"Bad Request","message":"querystring should have required property 'token'"}

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

` async function getSignedUrl() {
const { signedURL, error } = await supabase
.storage
.from("intervue-vids")
.createSignedUrl(PATH_TO_FILE, 6000)

if(error) throw error

setUrl(signedURL)

}

useEffect(() => {
getSignedUrl()
}, [])`

Expected behavior

Query would return a link that is streamable/viewable (my use case is a video file)

Screenshots

n/a

System information

  • OS: macOs,
  • Browser chrome
  • Version of supabase-js: 1.30.7
  • Version of Node.js: 6.14.15

Additional context

Add any other context about the problem here.

Closing the issue, as it seems like the original issue has been resolved.

I have run a test that creates signed url and it works as expected:

const file = {
  path: 'test.txt',
  data: faker.lorem.paragraph(),
}
await supabase.storage.from(bucket.name).upload(file.path, file.data)

// generate signedUrl
const { data, error } = await supabase.storage
  .from(bucket.name)
  .createSignedUrl(file.path, 10)
expect(error).toBeNull()

// download from signedUrl
const resp = await fetch(data.signedUrl)
expect(resp.status).toEqual(200)
expect(await resp.text()).toEqual(file.data)

could it be that you had an issue with expiresIn param?

  • @param expiresIn The number of seconds until the signed URL expires. For example, 60 for a URL which is valid for one minute.

Please do not hesitate to ping me if it is still relevant, and I will happily reopen it.
Cheers!