Skip to content

Commit c563f88

Browse files
[SDK] Fix SIWE auth forcing unnecessary chain switch
1 parent 99901dc commit c563f88

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/ten-parrots-poke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Fix siwe auth always forcing a switch chain call

packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function useSiweAuth(
9797
import("../../../../auth/core/sign-login-payload.js"),
9898
]);
9999

100-
if (payload.chain_id) {
100+
if (payload.chain_id && Number(payload.chain_id) !== chain.id) {
101101
await activeWallet.switchChain(
102102
getCachedChain(Number(payload.chain_id)),
103103
);

0 commit comments

Comments
 (0)