Skip to content

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

Open
raymondjacobson wants to merge 1 commit intomainfrom
fix/protocol-dashboard-oauth-write-scope
Open

Switch protocol dashboard to OAuth 2.0 write scope + image mirrors#14052
raymondjacobson wants to merge 1 commit intomainfrom
fix/protocol-dashboard-oauth-write-scope

Conversation

@raymondjacobson
Copy link
Copy Markdown
Member

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: 1d340d6

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

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