Skip to content

Conversation

@jnsdls
Copy link
Member

@jnsdls jnsdls commented May 7, 2025

TL;DR

Added support for forcing auth token usage in storage uploads.

What changed?

  • Added a useAuthToken: true flag to the storage upload request to ensure authentication tokens are always used for storage uploads
  • Extended the fetchWithHeaders function to accept a new useAuthToken parameter in its options

How to test?

  1. Perform a storage upload operation
  2. Verify that the authentication token is being properly included in the request headers
  3. Confirm that uploads complete successfully with proper authentication

Why make this change?

This change ensures that storage uploads always use authentication tokens, which is necessary for proper access control and attribution of uploaded content. Previously, there was no way to force auth token usage specifically for storage operations, which could lead to authentication issues in certain scenarios.


PR-Codex overview

This PR introduces a new feature to enforce the use of an authentication token for storage uploads in the fetchWithHeaders function, modifying how the token is handled based on the useAuthToken flag.

Detailed summary

  • Added useAuthToken option to fetchWithHeaders parameters.
  • Updated the logic to include the auth token only if useAuthToken is true.
  • Modified test cases to verify correct behavior when useAuthToken is true or false.
  • Changed test description for clarity on behavior with JWT.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@vercel
Copy link

vercel bot commented May 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2025 7:40pm
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2025 7:40pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2025 7:40pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2025 7:40pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2025 7:40pm

@changeset-bot
Copy link

changeset-bot bot commented May 7, 2025

⚠️ No Changeset found

Latest commit: e19dd76

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels May 7, 2025
Copy link
Member Author

jnsdls commented May 7, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 54.17 KB (+0.1% 🔺) 1.1 s (+0.1% 🔺) 248 ms (+135.02% 🔺) 1.4 s
thirdweb (cjs) 193.88 KB (+0.05% 🔺) 3.9 s (+0.05% 🔺) 537 ms (+35.38% 🔺) 4.5 s
thirdweb (minimal + tree-shaking) 5.69 KB (+0.19% 🔺) 114 ms (+0.19% 🔺) 71 ms (+930.95% 🔺) 185 ms
thirdweb/chains (tree-shaking) 524 B (0%) 11 ms (0%) 39 ms (+1523.53% 🔺) 49 ms
thirdweb/react (minimal + tree-shaking) 19.51 KB (-0.13% 🔽) 391 ms (-0.13% 🔽) 61 ms (+216.43% 🔺) 451 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants