Web3Auth / web3auth-web

Simple infrastructure that enables Web3 wallets and applications to provide seamless user logins for both mainstream and Web3.0 users.
https://web3auth.io/docs
Other
419 stars 227 forks source link

when logged in with external wallet, refresh page and switch chain mutilple times, web3auth will disconnect #1543

Closed raintreasure closed 9 months ago

raintreasure commented 1 year ago

Describe the bug

After logged in using external wallet (metamask), refresh the page, and then switchChain multiple times ( for example, switch between 0x1 and 0x5 back and forth), web3auth will disconnect , ADAPTER_EVENTS.DISCONNECTED event will be triggered, while metamask is still connected. If I execute switchChain again, it will switch success, but metamask modal will not pop out. If I log out, it will report an error : image

To Reproduce

Steps to reproduce the behavior:

  1. Start from web3uath-pnp-examples/web-modal-sdk/evm/react-evm-modal-example, connect with metamask
  2. SwitchChain function in react-evm-modal-example switch from 0x1 to 0x5, add a new function to swtich back from 0x5 to 0x1, and listen ADAPTER_EVENTS.DISCONNECTED event
  3. refresh page
  4. switch back and forth multiple times
  5. web3auth will disconnect, ADAPTER_EVENTS.DISCONNECTED event will be triggered, execute switchChain again, it will switch success, but metamask modal will not pop out. If you log out, it will report an error

Expected behavior

web3auth remain connected

Thebeast44 commented 10 months ago

Yes thanks

chaitanyapotti commented 9 months ago

This is fixed in v7