Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403 on storage request #565

Open
steveoh opened this issue Dec 13, 2022 · 2 comments
Open

403 on storage request #565

steveoh opened this issue Dec 13, 2022 · 2 comments

Comments

@steveoh
Copy link

steveoh commented Dec 13, 2022

Version info

React: 18.2.0

Firebase: 9.15.0

ReactFire: 4.2.2

Other (e.g. Node, browser, operating system) (if applicable): chrome

Test case

Steps to reproduce

  1. Upload a file to storage using useStorageTask
  2. show that image with a
  3. Remove that image with a deleteObject request.
  4. Upload a different image with the same name to the same path
  5. reactfire requests the file with the wrong access token and the request fails

Expected behavior

The correct token is used to display the image from storage

Actual behavior

An old token is used and the request fails

@steveoh
Copy link
Author

steveoh commented Dec 13, 2022

After digging a little deeper I think this is a firebase-js-sdk issue?

It's almost as if the token retrieved from https://github.com/firebase/firebase-js-sdk/blob/37f31c57b62bc6486bc08d9e5c64e2c32d25cb0a/packages/storage/src/implementation/metadata.ts#L171 isn't applied.

In this image you can see the token used vs the token sent back with the post are quite different.

image

@steveoh
Copy link
Author

steveoh commented Dec 14, 2022

This doesn't happen when I just use the firebase sdk so it must be in this package or one of it's dependencies (rxfire).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant