File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed
packages/thirdweb/src/wallets/connection Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " thirdweb " : patch
3
+ ---
4
+
5
+ Auto-login on autoconnect of IAW in all cases
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import type {
8
8
AuthArgsType ,
9
9
AuthStoredTokenWithCookieReturnType ,
10
10
} from "../in-app/core/authentication/types.js" ;
11
+ import { isInAppSigner } from "../in-app/core/wallet/is-in-app-signer.js" ;
11
12
import { getUrlToken } from "../in-app/web/lib/get-url-token.js" ;
12
13
import type { Wallet } from "../interfaces/wallet.js" ;
13
14
import {
@@ -192,7 +193,20 @@ const _autoConnectCore = async ({
192
193
}
193
194
194
195
// Auto-login with SIWE
195
- if ( urlToken && activeWallet && props . siweAuth ?. requiresAuth ) {
196
+ const isIAW =
197
+ activeWallet &&
198
+ isInAppSigner ( {
199
+ wallet : activeWallet ,
200
+ connectedWallets : activeWallet
201
+ ? [ activeWallet , ...otherWallets ]
202
+ : otherWallets ,
203
+ } ) ;
204
+ if (
205
+ isIAW &&
206
+ props . siweAuth ?. requiresAuth &&
207
+ ! props . siweAuth ?. isLoggedIn &&
208
+ ! props . siweAuth ?. isLoggingIn
209
+ ) {
196
210
await props . siweAuth ?. doLogin ( ) ;
197
211
}
198
212
manager . isAutoConnecting . setValue ( false ) ;
Original file line number Diff line number Diff line change @@ -125,5 +125,7 @@ export type AutoConnectProps = {
125
125
siweAuth ?: {
126
126
requiresAuth : boolean ;
127
127
doLogin : ( ) => Promise < void > ;
128
+ isLoggedIn : boolean | undefined ;
129
+ isLoggingIn : boolean | undefined ;
128
130
} ;
129
131
} ;
You can’t perform that action at this time.
0 commit comments