If User Rejects Metamask Signin Request, Must Reload Page to Reset

The “happy path” works great, but if Metamask signing is rejected, then the only way I can get the session to reinitialize properly is by reloading the page.

I’ve tried web3auth.logout() and web3auth.clearCache() but did not work

I see that ADAPTER_EVENTS.DISCONNECTED is invoked after web3auth.logout() is called

I’ve tried nullifying all of the providers and adaptors and reinitializing but the ADAPTER_EVENTS.CONNECTED event will not fire again unless the page is reloaded

I’m wondering if it might have to do with Metamask, the error is Failed to connect with wallet. Already connected

any known way to reset the session and trigger the sign-in prompt again in Metamask without having to reload the page?

Thanks

@ishmael Thanks for your recent communication.

Can you share your implementation code along with Web3Auth initialization and login?

@vjgee thanks for your response

your question prompted me to return to the pnp examples and to test the functionality I was seeking in the basic setups

it worked fine and help me to deduce which calls trigger which Metamask prompts

found that authenticateUser is the one that triggers the sign message prompt and connectTo is the one that triggers the switch / connect chain … from here I was able to refactor my implementation as needed

thank you!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.