thirdweb@5.121.0
Minor Changes
- #8887
133e57dThanks @0xFirekeeper! - Redirect-based in-app wallet logins now include and verify a one-timestatevalue beforeAutoConnectconsumes auth material returned in the URL, tying the returned token back to a flow the page actually started. Added areadUrlTokenoption toAutoConnect/useAutoConnectto opt out of reading wallet auth material from the URL entirely.
Patch Changes
-
#8886
e4fba08Thanks @blockgroot! - Fix:EIP1193.toProvider()'sremoveListeneris no longer a no-op. Previously,removeListenerdiscarded the unsubscribe function returned bywallet.subscribe(), so listeners registered viaprovider.on(...)(e.g.accountsChanged,chainChanged,disconnect) could never actually be detached — they kept firing after callers (such as wagmi connectors) believed they had unsubscribed.removeListenernow tracks and invokes the correct unsubscribe function per(event, listener)pair. -
#8807
8c521aaThanks @Yash094! - Fix: injected wallets (e.g. MetaMask) no longer fire a spurious"disconnect"event for transient EIP-1193 error code 1013 ("disconnected, will reconnect"). Previously, MetaMask's temporary disconnect during chain changes or RPC hiccups would trigger the thirdwebdisconnectsubscriber and tear down wallet state, causing unexpected logouts. TheonDisconnecthandler now ignores code-1013 errors and lets MetaMask reconnect automatically.Additionally, the
WalletEmitterEvents["disconnect"]type is updated fromnevertoWalletDisconnectError | undefined, sodisconnectsubscribers can inspect the underlying EIP-1193 error code and message when they need to distinguish disconnect causes. -
#8875
f411769Thanks @SashaMIT! - Reject SIWE login payloads with an unparseable Not Before or Expiration Time instead of skipping the time-bound checks.