fix: wallet SDK OAuth popup handoff#35
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Updates
@abstract-foundation/wallet-sdkso AGW auth methods do not try to run Google OAuth inside the embedded iframe when the wallet session is missing or unknown.The SDK now reads
authenticatedfrom the wallet-hostreadypayload. If the user is already authenticated,wallet_connect,eth_requestAccounts, andwallet_requestPermissionscan stay in iframe mode. Otherwise the SDK opens/popupfrom the dApp click, passes the dApp origin in the popup URL, and listens for a wallet-host__internal { type: "authenticated" }signal before switching back to iframe and replaying the pending connect request.Why
Google OAuth rejects embedded iframe/browser contexts, which caused the current wallet SDK demo login flow to navigate into an iframe-hosted OAuth error. Auth needs a top-level popup, while already-authenticated connect and later confirmation requests can still use the iframe UX.
Validation
pnpm install --frozen-lockfile --ignore-scriptspnpm --filter @abstract-foundation/wallet-sdk testpnpm --filter @abstract-foundation/wallet-sdk typecheckpnpm exec biome check packages/wallet-sdk/src/core/Dialog.ts packages/wallet-sdk/src/core/Messenger.ts packages/wallet-sdk/src/core/UserAgent.ts packages/wallet-sdk/src/core/Wallet.ts packages/wallet-sdk/test/src/Dialog.test.ts packages/wallet-sdk/test/src/Wallet.test.ts examples/wallet-sdk-nextjs/src/components/Demo.tsx