Add wallet auth button for account linking in ewk demo#1208
Open
radusandor wants to merge 1 commit intomainfrom
Open
Add wallet auth button for account linking in ewk demo#1208radusandor wants to merge 1 commit intomainfrom
radusandor wants to merge 1 commit intomainfrom
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 26fe5d9:
|
moeodeh3
reviewed
Feb 19, 2026
|
|
||
| const providers = await fetchWalletProviders(); | ||
| console.log(providers); | ||
| const selectedProvider = providers?.[0]; |
Contributor
There was a problem hiding this comment.
hmm - I’m not sure we can do this
right now, the user doesn’t get to choose which external wallet to use. We just automatically select the first one 😢
Ideally, we should present UI that allows the user to:
- choose which external wallet they want to use
- choose the chain (Solana vs Ethereum)
that said, we already have all of this UI logic built in @turnkey/react-wallet-kit for handleLogin(). Given that, I think the right better solution would be to introduce something like handleAddWallet() that reuses those UI components 🤔
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary & Motivation
This PR adds a WalletAuthButton component to the react-wallet-kit example, allowing users to link an external wallet (e.g. MetaMask, Phantom) as a backup authentication method to their existing account.
Changes:
Added
WalletAuthButton.tsxinsrc/components/demo/AuthButtons/following the same pattern as existing auth buttonsAdded
WalletSVGtosrc/components/Svg.tsxUpdated
UserSettings.tsxto renderWalletAuthButtonwhenwalletAuthEnabledis set in the configHow it works:
When a user clicks "+ Connect" on the Wallet button, it prompts their browser wallet to sign a request
The wallet's public key is stored as an API key in the user's sub-org under the label wallet-auth-{publicKey}
The user can then log in with that wallet as a backup authenticator
Unlinking removes the API key from the sub-org
How I Tested These Changes
Tested locally with Phantom (Solana) and MetaMask (EVM)
Verified wallet linking and unlinking with UI state refreshing correctly after each action
Verified that after linking, logging out and back in with the wallet routes to the correct sub-org