diff --git a/.changeset/ten-parrots-poke.md b/.changeset/ten-parrots-poke.md new file mode 100644 index 00000000000..4785e721f6b --- /dev/null +++ b/.changeset/ten-parrots-poke.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Fix siwe auth always forcing a switch chain call diff --git a/packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts b/packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts index 2a7516820c1..c23d7f52b69 100644 --- a/packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts +++ b/packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts @@ -97,7 +97,7 @@ export function useSiweAuth( import("../../../../auth/core/sign-login-payload.js"), ]); - if (payload.chain_id) { + if (payload.chain_id && Number(payload.chain_id) !== chain.id) { await activeWallet.switchChain( getCachedChain(Number(payload.chain_id)), );