Skip to content

feat: account linking#2423

Open
lionellbriones wants to merge 3 commits intomasterfrom
feat/account-linking
Open

feat: account linking#2423
lionellbriones wants to merge 3 commits intomasterfrom
feat/account-linking

Conversation

@lionellbriones
Copy link
Copy Markdown
Contributor

@lionellbriones lionellbriones commented Mar 27, 2026

Motivation and Context

Jira Link:

Description

How has this been tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code requires a db migration.

Note

Medium Risk
Introduces a new public linkWallet() API and a new modal page/flow, which can affect client integrations and modal state transitions. Linking is currently UI-driven (with simulated steps), so incomplete or incorrect wiring could confuse users or surface runtime errors when invoked while not connected.

Overview
Adds an account linking entrypoint to the modal SDK via IWeb3AuthModal.linkWallet() and Web3Auth.linkWallet(), which opens a new PAGES.LINK_WALLET screen after enforcing that the user is already connected.

Implements a new Link Wallet UI container with a multi-step flow (wallet selection → connecting → sign/verify → success) and wires it into the modal Root plus LoginModal.openLinkWallet().

Exposes the feature to Vue apps through a new useLinkWallet composable and updates the demo dashboard to include a Link Wallet button; also fixes several Vue button :loading bindings to use .value.

Written by Cursor Bugbot for commit 3a4d360. This will update automatically on new commits. Configure here.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web3auth-web Error Error Apr 2, 2026 11:03am

Request Review

>
Simulate error
</button>
</div>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporary simulate buttons committed in production components

High Severity

LinkWalletConnecting and LinkWalletSignVerify both include "Simulate success" and "Simulate error" buttons marked with TODO: remove -- temporary test buttons. These are visible to end users and allow bypassing the wallet connection and signature verification steps entirely — advancing through the link-wallet flow without any real wallet interaction.

Additional Locations (1)
Fix in Cursor Fix in Web

const externalButtons = useMemo(() => {
if (walletDiscoverySupported && !walletSearch && !isShowAllWallets) return defaultButtons;
return filteredButtons;
}, [walletDiscoverySupported, walletSearch, filteredButtons, defaultButtons, isShowAllWallets]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing auto-expand effect from duplicated wallet logic

Low Severity

LinkWallet duplicates the wallet discovery logic from ConnectWallet but omits the useEffect that auto-sets isShowAllWallets to true when totalExternalWalletsCount <= 15. In ConnectWallet, this effect ensures small wallet lists are fully expanded immediately. Without it, LinkWallet always starts with only the "default" subset visible and shows a "More Wallets" button — even when there are only a handful of wallets — creating a UX inconsistency. Extracting the shared filtering/sorting logic into a common hook would prevent such drift.

Fix in Cursor Fix in Web

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

const initialWalletCount = useMemo(() => {
if (isShowAllWallets) return totalExternalWalletsCount;
return walletDiscoverySupported ? defaultButtons.length : installedWalletButtons.length;
}, [walletDiscoverySupported, defaultButtons, installedWalletButtons, isShowAllWallets, totalExternalWalletsCount]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extensive duplicated wallet filtering logic across components

Medium Severity

LinkWallet.tsx duplicates nine memoized wallet filtering/sorting computations (~70 lines) nearly verbatim from ConnectWallet.tsx: walletDiscoverySupported, allUniqueButtons, defaultButtonKeys, defaultButtons, installedWalletButtons, filteredButtons, externalButtons, totalExternalWalletsCount, and initialWalletCount. No shared hook exists for this logic. A bug fix in one location risks being missed in the other, which is especially concerning given the complexity of the filtering/sorting chains.

Fix in Cursor Fix in Web

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

Successfully merging this pull request may close these issues.

1 participant