Skip to content

Commit 6c277ae

Browse files
[SDK] fix: Respect chain param in in-app wallet connection (#6068)
1 parent 153651d commit 6c277ae

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/kind-starfishes-sell.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+
Respect passed in chain when connecting to inapp wallet with wallet strategy

packages/thirdweb/src/wallets/in-app/core/authentication/siwe.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ export async function siweAuthenticate(args: {
1818
client: ThirdwebClient;
1919
ecosystem?: Ecosystem;
2020
}): Promise<AuthStoredTokenWithCookieReturnType> {
21-
const { wallet, chain } = args;
21+
const { wallet, chain, client, ecosystem } = args;
2222
// only connect if the wallet doesn't already have an account
2323
const account =
24-
wallet.getAccount() || (await wallet.connect({ client: args.client }));
25-
const clientFetch = getClientFetch(args.client, args.ecosystem);
24+
wallet.getAccount() || (await wallet.connect({ client, chain }));
25+
const clientFetch = getClientFetch(client, ecosystem);
2626

2727
const payload = await (async () => {
2828
const path = getLoginUrl({

0 commit comments

Comments
 (0)