Repository navigation
fix: wait for the Web3Auth AUTH connector before social login - #49
Merged
Merged
Conversation
Web3Auth v11 resolves init() before the AUTH connector finishes initializing, so connectTo() hit a not-ready connector and never settled. Wait for the connector to become ready (and for a cached session to finish rehydrating) with a timeout.
junghoon-vans
approved these changes
Nov 13, 2026
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
Fixes social login (Google / Twitter / Email passwordless) hanging with
Wallet connector is not ready yeton@adena-wallet/sdk@0.1.2(@web3auth/no-modal@11.4.3), and bumps the packages tov0.1.3.Root cause
In Web3Auth v11,
Web3AuthNoModal.init()resolves before connectors finish initializing:loadConnectors()→setConnectors()emitsCONNECTORS_UPDATEDsynchronously, and theasynclistener that runssetupConnector()→connector.init()is not awaited.AuthConnector.init()only setsstatus = READYand emitsREADYafter the auth iframe has loaded.GnoSocialWalletProvider.connect()calledconnectTo()right afterinit().connectTo()callsconnector.connect()inside anew Promise(...)executor without awaiting or catching it, so thecheckConnectionRequirements()error became an unhandled rejection, andconnectTo()(which only settles onCONNECTED/ERRORED) never settled. As a result,connectWallet()neither resolved nor rejected.There is also a restored-session case. When a cached session exists,
AuthConnector.init()emitsREADYand then immediately starts rehydrating it (status = CONNECTING). Waiting only forREADYwould still leaveweb3auth.connected === false, and callingconnectTo()at that point throwsAlready connectingthe same way.Changes
GnoSocialWalletProvider.initializeWeb3Auth()now callswaitForAuthConnectorReady()afterawait web3auth.init():embeddedWalletAuth.not_ready, waits forREADYand rejects onERRORED.connecting(rehydrating a cached session), waits for Web3AuthCONNECTEDor connectorREHYDRATION_ERROR. After a rehydration error the connector isreadyagain, so a fresh login follows.CONNECTOR_STATUS/CONNECTOR_EVENTSfrom@web3auth/no-modalinstead of string literals.CONNECTOR_STATUS/CONNECTOR_EVENTSto the Jest stub of@web3auth/no-modal.package.jsonandpackages/sdk/package.jsonto0.1.3.Tests
Added
gno-social-wallet-connect.test.ts, which uses a mockedWeb3AuthNoModal:init()resolves while the connector isnot_ready→connectTois called only afterreadyready→ no waiterrored→connect()returnsfalsewithout callingconnectToreadywithin 30s →connect()returnsfalsewith a timeout errorconnect()returnsfalsewith a clear errorconnectedand reuses the session withoutconnectToconnectToWithout the fix, 6 of the 7 new tests fail. The "already ready" test passes either way.
yarn jest(162 tests),yarn lint, andyarn buildpass.Release
Publish as
@adena-wallet/sdk@0.1.3. The consumer (gnoswap-interface PR #1091) will then bump from^0.1.2to^0.1.3.