Skip to content

fix(passport,wallet): prevent login popup on page load and fix wallet address display after OAuth redirect#2801

Merged
rodrigo-fournier-immutable merged 2 commits into
mainfrom
BSB-31
Mar 18, 2026
Merged

fix(passport,wallet): prevent login popup on page load and fix wallet address display after OAuth redirect#2801
rodrigo-fournier-immutable merged 2 commits into
mainfrom
BSB-31

Conversation

@rodrigo-fournier-immutable

@rodrigo-fournier-immutable rodrigo-fournier-immutable commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Fix 2 issues in SDK 2.12.7

Summary

This PR addresses Issues 1 and 2 reported after upgrading to @imtbl/sdk ^2.12.7 in the Treeverse integration. See docs/TREEVERSE_ISSUES_ANALYSIS.md for the full analysis.


Issue 1: Passport login popup opens automatically on page load

Expected: Login popup should only appear when the user clicks "Connect Wallet" (which calls eth_requestAccounts).

Fix: Added silent parameter to GetUserFunction. When connectEvm() runs on page load, it now calls getUser(undefined, { silent: true }) to avoid triggering loginWithPopup().

Packages: wallet, passport


Issue 2: UI does not update after successful login (redirect)

Expected: After OAuth redirect, the navbar should immediately show the connected wallet address.

Fix: Added LOGGED_IN listener to ZkEvmProvider. When the user returns from redirect, loginCallback() emits LOGGED_IN and the provider now emits ACCOUNTS_CHANGED so the UI updates.

Packages: wallet


How to test locally

Issue 1: Popup on page load

  1. Setup:

    pnpm install
    pnpm --filter @imtbl/passport-sdk-sample-app run dev-with-sdk
  2. Test flow:

    • Select Sandbox environment on the initial page
    • The "Treeverse Flow Simulation (Issue 1)" section will appear
    • Expected (fixed): No popup on page load; popup opens only when clicking "Manual: eth_requestAccounts" or Connect Wallet
  3. Location: packages/passport/sdk-sample-app/src/components/TreeverseFlowSimulation.tsx


Issue 2: UI not updating after redirect

  1. Setup:

    pnpm install
    pnpm --filter @imtbl/passport-sdk-sample-app run dev-with-sdk
  2. Test flow:

    • Select Sandbox environment on the initial page
    • Click Login (Google) (or Login (Apple), Login (Facebook)) — buttons without "Popup" prefix
    • You will be redirected to Immutable OAuth
    • Complete login (Google, etc.)
    • You will be redirected to /login/redirect-callback
    • Expected (fixed): Wallet address should be displayed immediately after loginCallback
  3. Location: packages/passport/sdk-sample-app/src/pages/login/redirect-callback.page.tsx

… LOGGED_IN

- Add silent option to GetUserFunction to avoid popup when checking session on page load
- Add LOGGED_IN listener in ZkEvmProvider to emit ACCOUNTS_CHANGED after redirect login
- Fixes Issue 1: popup opening automatically on load
- Fixes Issue 2: UI not updating after login via redirect
@rodrigo-fournier-immutable rodrigo-fournier-immutable requested a review from a team as a code owner March 17, 2026 01:16
@rodrigo-fournier-immutable rodrigo-fournier-immutable changed the title fix: resolve Treeverse issues 1, 2, 3 (passport, wallet, checkout-widgets) fix: BSB-31 resolve Treeverse issues 1, 2, 3 (passport, wallet, checkout-widgets) Mar 17, 2026
@nx-cloud

nx-cloud Bot commented Mar 17, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 6a86e73

Command Status Duration Result
nx affected -t build,lint,test ✅ Succeeded 3m 19s View ↗
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 1m 28s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-18 22:18:41 UTC

@nx-cloud

nx-cloud Bot commented Mar 17, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit e7c4513

Command Status Duration Result
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 1m 26s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-17 01:18:52 UTC

@rodrigo-fournier-immutable rodrigo-fournier-immutable changed the title fix: BSB-31 resolve Treeverse issues 1, 2, 3 (passport, wallet, checkout-widgets) fix(passport,checkout): resolve Treeverse issues 1, 2, 3 (passport, wallet, checkout-widgets) Mar 17, 2026
@rodrigo-fournier-immutable rodrigo-fournier-immutable changed the title fix(passport,checkout): resolve Treeverse issues 1, 2, 3 (passport, wallet, checkout-widgets) fix(passport,wallet): resolve Treeverse issues 1 and 2 (passport, wallet) Mar 18, 2026
@rodrigo-fournier-immutable rodrigo-fournier-immutable changed the title fix(passport,wallet): resolve Treeverse issues 1 and 2 (passport, wallet) fix(passport): resolve passport login issues Mar 18, 2026
@rodrigo-fournier-immutable rodrigo-fournier-immutable changed the title fix(passport): resolve passport login issues fix(passport,wallet): prevent login popup on page load and fix wallet address display after OAuth redirect Mar 18, 2026
Comment thread packages/wallet/src/types.ts
Comment thread packages/wallet/src/types.ts Outdated
Comment thread packages/wallet/src/connectWallet.test.ts
Comment thread packages/wallet/src/zkEvm/zkEvmProvider.ts Outdated
… redirect

- Add LOGGED_IN listener in zkEvmProvider to emit accountsChanged
- Remove redundant #callSessionActivity from handleLoggedIn
- Add connectWallet silent/non-silent flow tests
- Add zkEvmProvider LOGGED_IN test
@rodrigo-fournier-immutable rodrigo-fournier-immutable added this pull request to the merge queue Mar 18, 2026
Merged via the queue into main with commit 609739c Mar 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants