Skip to content

Switch protocol dashboard to OAuth 2.0 write scope + image mirrors#14052

Merged
raymondjacobson merged 5 commits intomainfrom
fix/protocol-dashboard-oauth-write-scope
Apr 4, 2026
Merged

Switch protocol dashboard to OAuth 2.0 write scope + image mirrors#14052
raymondjacobson merged 5 commits intomainfrom
fix/protocol-dashboard-oauth-write-scope

Conversation

@raymondjacobson
Copy link
Copy Markdown
Member

@raymondjacobson raymondjacobson commented Apr 3, 2026

Summary

  • OAuth 2.0 migration: Replace deprecated write_once scope with standard write scope for the Connect Audius Profile flow. Rewrites useConnectAudiusProfile hook to construct OAuth URL manually with PKCE, sign wallet signatures with ethers (instead of audiusLibs.web3Manager), and exchange auth codes for tokens after the popup completes. Removes all references to old SDK OAuth APIs (oauth.init, getCsrfToken, activePopupWindow, OAUTH_URL).
  • Web app OAuth page: Extends write scope to support tx=connect_dashboard_wallet / tx=disconnect_dashboard_wallet params, reusing existing handleAuthorizeConnectDashboardWallet / handleAuthorizeDisconnectDashboardWallet handlers.
  • Image mirror support: Adds MirrorImage component with 3-second per-URL timeout fallback for profile pictures and trending artwork. Replaces raw <img> tags and backgroundImage inline styles that would stall on unresponsive content nodes.

Test plan

  • Connect Audius Profile: click button → popup opens → authenticate → profile picture + name appear
  • Disconnect Audius Profile: click Unlink → popup opens → authenticate → profile removed
  • Profile pictures load with mirror fallback (simulate slow node by throttling network)
  • Trending tracks/playlists/albums artwork loads correctly with mirror fallback
  • Wallet connection via Web3Modal still works (no regression)
  • npm run verify passes in protocol-dashboard

🤖 Generated with Claude Code

…dd image mirror support

Replace the deprecated write_once OAuth scope with standard write scope for the
Connect Audius Profile flow. The old SDK APIs (oauth.init, getCsrfToken,
activePopupWindow, OAUTH_URL) no longer exist — rewrite the hook to construct
the OAuth URL manually with PKCE, sign wallet signatures with ethers instead of
audiusLibs, and exchange auth codes for tokens after the popup completes.

Also add mirror-based image loading with 3-second per-URL timeout fallback for
profile pictures and trending artwork, replacing raw <img> tags that would stall
indefinitely on unresponsive content nodes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 3, 2026

⚠️ No Changeset found

Latest commit: d5df68f

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

@gitguardian
Copy link
Copy Markdown

gitguardian bot commented Apr 3, 2026

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
27814482 Triggered Generic High Entropy Secret 1d340d6 packages/protocol-dashboard/src/services/Audius/sdk.ts View secret
27814482 Triggered Generic High Entropy Secret 1d340d6 packages/protocol-dashboard/src/hooks/useConnectAudiusProfile.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

🌐 Web preview ready

Preview URL: https://audius-web-preview-pr-14052.audius.workers.dev

Unique preview for this PR (deployed from this branch).
Workflow run

raymondjacobson and others added 4 commits April 4, 2026 00:19
- Fix walletProvider not being passed through component chain
- Use EIP-1193 personal_sign instead of ethers BrowserProvider
- Add esbuild plugin to resolve ethers v6 for @Web3Modal (fixes dep optimization crash)
- Inline badgeTiers to avoid circular dependency from @audius/common/store
- Remove debug logging

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The protocol dashboard now uses standard write scope with PKCE, so
write_once is dead code. Remove it from scope validation, collapsing,
and the authorize flow. Rename WriteOnceTx/WriteOnceParams to
DashboardWalletTx/DashboardWalletParams and clean up type casts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@raymondjacobson raymondjacobson merged commit 5bbd879 into main Apr 4, 2026
14 checks passed
@raymondjacobson raymondjacobson deleted the fix/protocol-dashboard-oauth-write-scope branch April 4, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant