Web3Auth modal connect() never returns when the modal is closed without signing in #1366
edouardruiz
announced in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Issue title: Return
nullfromweb3auth.connect()when the user closes the modal without signing inDescribe the question
The
@web3auth/modaldocumentation regardingconnect()states that it will return aSafeEventEmitterProviderinstance on success andnullvalue on error. This is correct according to what I see in the code and the events listened by theWeb3Authinstance (ADAPTER_EVENTS.CONNECTEDandADAPTER_EVENTS.ERRORED).However when the user closes the modal without signing in, no event is fired and no promise ever resolves until the user opens the modal again and actually tries to login. Multiple events are then fired if he fails or succeeds since the event listeners attached on the first attempt aren't removed.
Steps to Reproduce
Steps to reproduce the behavior:
web3auth.connect()callExpected behavior:
It would make sense to return
nullfromconnect()when the modal is closed without any login attempt.Platform Details
@web3auth/modal)Additional context
You can wrap the call to
connect()inconsole.logto see that all after statements are triggered when theconnect()promise resolves.Beta Was this translation helpful? Give feedback.
All reactions