@dynamic-labs/sdk-react-core 3.0.0-alpha.43 → 3.0.0-alpha.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.cjs +5 -1
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.js +5 -1
- package/src/lib/utils/functions/socialStorage/socialStorage.d.ts +2 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +2 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +2 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +2 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +2 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +7 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +7 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +3 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +3 -2
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.cjs +1 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.js +1 -0
- package/src/lib/views/EmailVerification/EmailVerification.cjs +1 -0
- package/src/lib/views/EmailVerification/EmailVerification.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
## [3.0.0-alpha.45](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.44...v3.0.0-alpha.45) (2024-08-16)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* always check for dynamicOauthCode and use during signin or verify ([#6618](https://github.com/dynamic-labs/DynamicAuth/issues/6618)) ([dd33231](https://github.com/dynamic-labs/DynamicAuth/commit/dd332310c9fdfa7bb593b7f567751133a93c6938))
|
|
8
|
+
* display qr code when no primary is selected ([#6605](https://github.com/dynamic-labs/DynamicAuth/issues/6605)) ([406afa3](https://github.com/dynamic-labs/DynamicAuth/commit/406afa32b38a29a2d8ce96803ae45ab35adb5ce3))
|
|
9
|
+
|
|
10
|
+
## [3.0.0-alpha.44](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.43...v3.0.0-alpha.44) (2024-08-15)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* populate wallet new isPrimary flag ([#6597](https://github.com/dynamic-labs/DynamicAuth/issues/6597)) ([7809f81](https://github.com/dynamic-labs/DynamicAuth/commit/7809f81c9743b8bf7bc27dc34cf45923cf9baf99))
|
|
16
|
+
* twitter should no longer rely polling for oauth flow ([#6603](https://github.com/dynamic-labs/DynamicAuth/issues/6603)) ([09aea8b](https://github.com/dynamic-labs/DynamicAuth/commit/09aea8b3f197c25dcfb5bc72049b90859df246f3))
|
|
17
|
+
|
|
2
18
|
## [3.0.0-alpha.43](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.42...v3.0.0-alpha.43) (2024-08-15)
|
|
3
19
|
|
|
4
20
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.45",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"react-i18next": "13.5.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
|
-
"@dynamic-labs/iconic": "3.0.0-alpha.
|
|
21
|
-
"@dynamic-labs/logger": "3.0.0-alpha.
|
|
22
|
-
"@dynamic-labs/message-transport": "3.0.0-alpha.
|
|
23
|
-
"@dynamic-labs/multi-wallet": "3.0.0-alpha.
|
|
24
|
-
"@dynamic-labs/rpc-providers": "3.0.0-alpha.
|
|
25
|
-
"@dynamic-labs/store": "3.0.0-alpha.
|
|
26
|
-
"@dynamic-labs/types": "3.0.0-alpha.
|
|
27
|
-
"@dynamic-labs/utils": "3.0.0-alpha.
|
|
28
|
-
"@dynamic-labs/viem-utils": "3.0.0-alpha.
|
|
29
|
-
"@dynamic-labs/wallet-book": "3.0.0-alpha.
|
|
30
|
-
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.
|
|
20
|
+
"@dynamic-labs/iconic": "3.0.0-alpha.45",
|
|
21
|
+
"@dynamic-labs/logger": "3.0.0-alpha.45",
|
|
22
|
+
"@dynamic-labs/message-transport": "3.0.0-alpha.45",
|
|
23
|
+
"@dynamic-labs/multi-wallet": "3.0.0-alpha.45",
|
|
24
|
+
"@dynamic-labs/rpc-providers": "3.0.0-alpha.45",
|
|
25
|
+
"@dynamic-labs/store": "3.0.0-alpha.45",
|
|
26
|
+
"@dynamic-labs/types": "3.0.0-alpha.45",
|
|
27
|
+
"@dynamic-labs/utils": "3.0.0-alpha.45",
|
|
28
|
+
"@dynamic-labs/viem-utils": "3.0.0-alpha.45",
|
|
29
|
+
"@dynamic-labs/wallet-book": "3.0.0-alpha.45",
|
|
30
|
+
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.45",
|
|
31
31
|
"eventemitter3": "5.0.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
@@ -122,12 +122,15 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
|
122
122
|
return;
|
|
123
123
|
const url = new URL(window.location.href);
|
|
124
124
|
const dynamicOauthState = url.searchParams.get('dynamicOauthState');
|
|
125
|
-
|
|
125
|
+
const dynamicOauthCode = url.searchParams.get('dynamicOauthCode');
|
|
126
|
+
if (!dynamicOauthState || !dynamicOauthCode) {
|
|
126
127
|
return;
|
|
127
128
|
}
|
|
128
129
|
const socialStorageItem = socialStorage.searchSocialStorageByState(dynamicOauthState);
|
|
129
130
|
if (!socialStorageItem)
|
|
130
131
|
return;
|
|
132
|
+
// we got back the dynamicOauthCode from the oauth provider, set it here so we can use it to sign in
|
|
133
|
+
socialStorageItem.code = dynamicOauthCode;
|
|
131
134
|
setSocialStorageItem(socialStorageItem);
|
|
132
135
|
// Clear the state from local storage
|
|
133
136
|
socialStorage.deleteSocialStorage(socialStorageItem.provider);
|
|
@@ -144,6 +147,7 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
|
144
147
|
updateInterfaceStateForLink();
|
|
145
148
|
}
|
|
146
149
|
yield completeConnection({
|
|
150
|
+
authCode: socialStorageItem.code,
|
|
147
151
|
authMode,
|
|
148
152
|
captchaToken: socialStorageItem.captchaToken,
|
|
149
153
|
provider: socialStorageItem.provider,
|
|
@@ -118,12 +118,15 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
|
118
118
|
return;
|
|
119
119
|
const url = new URL(window.location.href);
|
|
120
120
|
const dynamicOauthState = url.searchParams.get('dynamicOauthState');
|
|
121
|
-
|
|
121
|
+
const dynamicOauthCode = url.searchParams.get('dynamicOauthCode');
|
|
122
|
+
if (!dynamicOauthState || !dynamicOauthCode) {
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
124
125
|
const socialStorageItem = searchSocialStorageByState(dynamicOauthState);
|
|
125
126
|
if (!socialStorageItem)
|
|
126
127
|
return;
|
|
128
|
+
// we got back the dynamicOauthCode from the oauth provider, set it here so we can use it to sign in
|
|
129
|
+
socialStorageItem.code = dynamicOauthCode;
|
|
127
130
|
setSocialStorageItem(socialStorageItem);
|
|
128
131
|
// Clear the state from local storage
|
|
129
132
|
deleteSocialStorage(socialStorageItem.provider);
|
|
@@ -140,6 +143,7 @@ const useRedirectSocialHandler = ({ setSocialProvider, }) => {
|
|
|
140
143
|
updateInterfaceStateForLink();
|
|
141
144
|
}
|
|
142
145
|
yield completeConnection({
|
|
146
|
+
authCode: socialStorageItem.code,
|
|
143
147
|
authMode,
|
|
144
148
|
captchaToken: socialStorageItem.captchaToken,
|
|
145
149
|
provider: socialStorageItem.provider,
|
|
@@ -8,6 +8,8 @@ export type SocialStorageItem = {
|
|
|
8
8
|
codeVerifier: string | undefined;
|
|
9
9
|
/** Captcha token used to verify the user is not a bot */
|
|
10
10
|
captchaToken?: string;
|
|
11
|
+
/** Oauth code from redirect from oauth provider, this will be provided on response from redirect endpoint **/
|
|
12
|
+
code?: string;
|
|
11
13
|
};
|
|
12
14
|
export type SocialStorage = Partial<Record<ProviderEnum, SocialStorageItem>>;
|
|
13
15
|
export declare const searchSocialStorageByState: (targetState: string) => SocialStorageItem | undefined;
|
|
@@ -165,6 +165,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
165
165
|
connector: walletConnector,
|
|
166
166
|
id: storedConnectedWalletInfo.id,
|
|
167
167
|
isAuthenticated: false,
|
|
168
|
+
isPrimary: primaryWalletId === storedConnectedWalletInfo.id,
|
|
168
169
|
key: walletConnector.key,
|
|
169
170
|
network: walletNetwork,
|
|
170
171
|
});
|
|
@@ -176,6 +177,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
176
177
|
disconnectWallet,
|
|
177
178
|
setConnectedWallets,
|
|
178
179
|
walletConnectorOptions,
|
|
180
|
+
primaryWalletId,
|
|
179
181
|
]);
|
|
180
182
|
// Generate the connectedWallets list when connectedWalletsInfo (localStorage) or memoized wallet connector updates
|
|
181
183
|
React.useEffect(() => {
|
|
@@ -161,6 +161,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
161
161
|
connector: walletConnector,
|
|
162
162
|
id: storedConnectedWalletInfo.id,
|
|
163
163
|
isAuthenticated: false,
|
|
164
|
+
isPrimary: primaryWalletId === storedConnectedWalletInfo.id,
|
|
164
165
|
key: walletConnector.key,
|
|
165
166
|
network: walletNetwork,
|
|
166
167
|
});
|
|
@@ -172,6 +173,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
172
173
|
disconnectWallet,
|
|
173
174
|
setConnectedWallets,
|
|
174
175
|
walletConnectorOptions,
|
|
176
|
+
primaryWalletId,
|
|
175
177
|
]);
|
|
176
178
|
// Generate the connectedWallets list when connectedWalletsInfo (localStorage) or memoized wallet connector updates
|
|
177
179
|
useEffect(() => {
|
package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs
CHANGED
|
@@ -112,6 +112,7 @@ const useCoinbaseMPC = () => {
|
|
|
112
112
|
connector,
|
|
113
113
|
id: embeddedWalletVerifiedCredential.id,
|
|
114
114
|
isAuthenticated: true,
|
|
115
|
+
isPrimary: true,
|
|
115
116
|
key: (_a = embeddedWalletVerifiedCredential.walletName) !== null && _a !== void 0 ? _a : connector.key,
|
|
116
117
|
});
|
|
117
118
|
return coinbaseMPCWallet;
|
|
@@ -178,6 +179,7 @@ const useCoinbaseMPC = () => {
|
|
|
178
179
|
connector,
|
|
179
180
|
id: newSelectedCredentialWallet.id,
|
|
180
181
|
isAuthenticated: true,
|
|
182
|
+
isPrimary: true,
|
|
181
183
|
key: (_c = newSelectedCredentialWallet.walletName) !== null && _c !== void 0 ? _c : connector.key,
|
|
182
184
|
});
|
|
183
185
|
dynamicEvents.dynamicEvents.emit('embeddedWalletCreated', coinbaseMPCWallet, newSelectedCredentialWallet, updatedUser);
|
package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js
CHANGED
|
@@ -108,6 +108,7 @@ const useCoinbaseMPC = () => {
|
|
|
108
108
|
connector,
|
|
109
109
|
id: embeddedWalletVerifiedCredential.id,
|
|
110
110
|
isAuthenticated: true,
|
|
111
|
+
isPrimary: true,
|
|
111
112
|
key: (_a = embeddedWalletVerifiedCredential.walletName) !== null && _a !== void 0 ? _a : connector.key,
|
|
112
113
|
});
|
|
113
114
|
return coinbaseMPCWallet;
|
|
@@ -174,6 +175,7 @@ const useCoinbaseMPC = () => {
|
|
|
174
175
|
connector,
|
|
175
176
|
id: newSelectedCredentialWallet.id,
|
|
176
177
|
isAuthenticated: true,
|
|
178
|
+
isPrimary: true,
|
|
177
179
|
key: (_c = newSelectedCredentialWallet.walletName) !== null && _c !== void 0 ? _c : connector.key,
|
|
178
180
|
});
|
|
179
181
|
dynamicEvents.emit('embeddedWalletCreated', coinbaseMPCWallet, newSelectedCredentialWallet, updatedUser);
|
|
@@ -148,6 +148,7 @@ const useTurnkey = () => {
|
|
|
148
148
|
var _a, _b, _c, _d;
|
|
149
149
|
const { chain } = embeddedWalletVerifiedCredential;
|
|
150
150
|
const turnkeyWallet = findTurnkeyWallet.findTurnkeyWalletByChain(walletConnectorOptions, chain);
|
|
151
|
+
let newPrimaryWalletId = null;
|
|
151
152
|
// if user already has embedded wallet, set it as primary wallet
|
|
152
153
|
if (user) {
|
|
153
154
|
(_a = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _a === void 0 ? void 0 : _a.setVerifiedCredentials(user.verifiedCredentials);
|
|
@@ -158,12 +159,14 @@ const useTurnkey = () => {
|
|
|
158
159
|
verifiedCredentials: user.verifiedCredentials,
|
|
159
160
|
walletConnectorOptions,
|
|
160
161
|
});
|
|
161
|
-
|
|
162
|
+
newPrimaryWalletId = smartWallet$1.id;
|
|
162
163
|
}
|
|
163
164
|
else {
|
|
164
|
-
|
|
165
|
+
newPrimaryWalletId = embeddedWalletVerifiedCredential.id;
|
|
165
166
|
}
|
|
166
167
|
}
|
|
168
|
+
if (newPrimaryWalletId)
|
|
169
|
+
setPrimaryWalletId(newPrimaryWalletId);
|
|
167
170
|
/** It's not authenticated if it still hasn't created a passkey */
|
|
168
171
|
const isAuthenticated = Boolean((_b = embeddedWalletVerifiedCredential.walletProperties) === null || _b === void 0 ? void 0 : _b.isAuthenticatorAttached);
|
|
169
172
|
const passkeyWallet = new walletConnectorCore.Wallet({
|
|
@@ -172,6 +175,7 @@ const useTurnkey = () => {
|
|
|
172
175
|
connector: (turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) || {},
|
|
173
176
|
id: embeddedWalletVerifiedCredential.id,
|
|
174
177
|
isAuthenticated,
|
|
178
|
+
isPrimary: newPrimaryWalletId === embeddedWalletVerifiedCredential.id,
|
|
175
179
|
key: embeddedWalletVerifiedCredential.walletName ||
|
|
176
180
|
(turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector.key) ||
|
|
177
181
|
'',
|
|
@@ -224,6 +228,7 @@ const useTurnkey = () => {
|
|
|
224
228
|
connector: walletConnector,
|
|
225
229
|
id: embeddedWalletVerifiedCredential.id,
|
|
226
230
|
isAuthenticated: Boolean((_h = embeddedWalletVerifiedCredential === null || embeddedWalletVerifiedCredential === void 0 ? void 0 : embeddedWalletVerifiedCredential.walletProperties) === null || _h === void 0 ? void 0 : _h.isAuthenticatorAttached),
|
|
231
|
+
isPrimary: true,
|
|
227
232
|
key: (_j = embeddedWalletVerifiedCredential.walletName) !== null && _j !== void 0 ? _j : walletConnector.key,
|
|
228
233
|
});
|
|
229
234
|
setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
|
|
@@ -144,6 +144,7 @@ const useTurnkey = () => {
|
|
|
144
144
|
var _a, _b, _c, _d;
|
|
145
145
|
const { chain } = embeddedWalletVerifiedCredential;
|
|
146
146
|
const turnkeyWallet = findTurnkeyWalletByChain(walletConnectorOptions, chain);
|
|
147
|
+
let newPrimaryWalletId = null;
|
|
147
148
|
// if user already has embedded wallet, set it as primary wallet
|
|
148
149
|
if (user) {
|
|
149
150
|
(_a = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _a === void 0 ? void 0 : _a.setVerifiedCredentials(user.verifiedCredentials);
|
|
@@ -154,12 +155,14 @@ const useTurnkey = () => {
|
|
|
154
155
|
verifiedCredentials: user.verifiedCredentials,
|
|
155
156
|
walletConnectorOptions,
|
|
156
157
|
});
|
|
157
|
-
|
|
158
|
+
newPrimaryWalletId = smartWallet.id;
|
|
158
159
|
}
|
|
159
160
|
else {
|
|
160
|
-
|
|
161
|
+
newPrimaryWalletId = embeddedWalletVerifiedCredential.id;
|
|
161
162
|
}
|
|
162
163
|
}
|
|
164
|
+
if (newPrimaryWalletId)
|
|
165
|
+
setPrimaryWalletId(newPrimaryWalletId);
|
|
163
166
|
/** It's not authenticated if it still hasn't created a passkey */
|
|
164
167
|
const isAuthenticated = Boolean((_b = embeddedWalletVerifiedCredential.walletProperties) === null || _b === void 0 ? void 0 : _b.isAuthenticatorAttached);
|
|
165
168
|
const passkeyWallet = new Wallet({
|
|
@@ -168,6 +171,7 @@ const useTurnkey = () => {
|
|
|
168
171
|
connector: (turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) || {},
|
|
169
172
|
id: embeddedWalletVerifiedCredential.id,
|
|
170
173
|
isAuthenticated,
|
|
174
|
+
isPrimary: newPrimaryWalletId === embeddedWalletVerifiedCredential.id,
|
|
171
175
|
key: embeddedWalletVerifiedCredential.walletName ||
|
|
172
176
|
(turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector.key) ||
|
|
173
177
|
'',
|
|
@@ -220,6 +224,7 @@ const useTurnkey = () => {
|
|
|
220
224
|
connector: walletConnector,
|
|
221
225
|
id: embeddedWalletVerifiedCredential.id,
|
|
222
226
|
isAuthenticated: Boolean((_h = embeddedWalletVerifiedCredential === null || embeddedWalletVerifiedCredential === void 0 ? void 0 : embeddedWalletVerifiedCredential.walletProperties) === null || _h === void 0 ? void 0 : _h.isAuthenticatorAttached),
|
|
227
|
+
isPrimary: true,
|
|
223
228
|
key: (_j = embeddedWalletVerifiedCredential.walletName) !== null && _j !== void 0 ? _j : walletConnector.key,
|
|
224
229
|
});
|
|
225
230
|
setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
|
|
@@ -241,7 +241,7 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
241
241
|
const mobileRedirectUrl = effectiveRedirectUrl || window.location.href;
|
|
242
242
|
return oauth.initAuth(environmentId, provider, {
|
|
243
243
|
redirectUrl: isMobile
|
|
244
|
-
?
|
|
244
|
+
? removeDynamicOauthParamsFromUrl(mobileRedirectUrl)
|
|
245
245
|
: undefined,
|
|
246
246
|
state,
|
|
247
247
|
});
|
|
@@ -394,9 +394,10 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
394
394
|
setIsProcessing,
|
|
395
395
|
};
|
|
396
396
|
};
|
|
397
|
-
const
|
|
397
|
+
const removeDynamicOauthParamsFromUrl = (url) => {
|
|
398
398
|
const urlObject = new URL(url);
|
|
399
399
|
urlObject.searchParams.delete('dynamicOauthState');
|
|
400
|
+
urlObject.searchParams.delete('dynamicOauthCode');
|
|
400
401
|
return urlObject.toString();
|
|
401
402
|
};
|
|
402
403
|
|
|
@@ -237,7 +237,7 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
237
237
|
const mobileRedirectUrl = effectiveRedirectUrl || window.location.href;
|
|
238
238
|
return initAuth(environmentId, provider, {
|
|
239
239
|
redirectUrl: isMobile$1
|
|
240
|
-
?
|
|
240
|
+
? removeDynamicOauthParamsFromUrl(mobileRedirectUrl)
|
|
241
241
|
: undefined,
|
|
242
242
|
state,
|
|
243
243
|
});
|
|
@@ -390,9 +390,10 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
390
390
|
setIsProcessing,
|
|
391
391
|
};
|
|
392
392
|
};
|
|
393
|
-
const
|
|
393
|
+
const removeDynamicOauthParamsFromUrl = (url) => {
|
|
394
394
|
const urlObject = new URL(url);
|
|
395
395
|
urlObject.searchParams.delete('dynamicOauthState');
|
|
396
|
+
urlObject.searchParams.delete('dynamicOauthCode');
|
|
396
397
|
return urlObject.toString();
|
|
397
398
|
};
|
|
398
399
|
|
|
@@ -177,7 +177,7 @@ const useWalletConnectors = ({ authMode, connectedWallets, walletConnectorOption
|
|
|
177
177
|
const setPrimaryWallet = React.useCallback((walletId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
178
178
|
const { newWallet: newPrimaryWallet, connectedAccounts } = yield getSelectedWallet(walletId);
|
|
179
179
|
newPrimaryWallet.isPrimary = true;
|
|
180
|
-
if (!primaryWalletId) {
|
|
180
|
+
if (!primaryWalletId && !checkIfShowQrCodeModal(newPrimaryWallet)) {
|
|
181
181
|
yield newPrimaryWallet.connector.connect();
|
|
182
182
|
setPrimaryWalletId(walletId);
|
|
183
183
|
return;
|
|
@@ -173,7 +173,7 @@ const useWalletConnectors = ({ authMode, connectedWallets, walletConnectorOption
|
|
|
173
173
|
const setPrimaryWallet = useCallback((walletId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
174
174
|
const { newWallet: newPrimaryWallet, connectedAccounts } = yield getSelectedWallet(walletId);
|
|
175
175
|
newPrimaryWallet.isPrimary = true;
|
|
176
|
-
if (!primaryWalletId) {
|
|
176
|
+
if (!primaryWalletId && !checkIfShowQrCodeModal(newPrimaryWallet)) {
|
|
177
177
|
yield newPrimaryWallet.connector.connect();
|
|
178
178
|
setPrimaryWalletId(walletId);
|
|
179
179
|
return;
|
|
@@ -131,6 +131,7 @@ const createLinkedWalletsFromWalletOptions = ({ user, walletConnectorOptions, pr
|
|
|
131
131
|
connector: wallet.walletConnector,
|
|
132
132
|
id: account.id,
|
|
133
133
|
isAuthenticated: true,
|
|
134
|
+
isPrimary: account.id === primaryWalletId,
|
|
134
135
|
key: (_a = account.walletName) !== null && _a !== void 0 ? _a : wallet.walletConnector.key,
|
|
135
136
|
});
|
|
136
137
|
}
|
|
@@ -127,6 +127,7 @@ const createLinkedWalletsFromWalletOptions = ({ user, walletConnectorOptions, pr
|
|
|
127
127
|
connector: wallet.walletConnector,
|
|
128
128
|
id: account.id,
|
|
129
129
|
isAuthenticated: true,
|
|
130
|
+
isPrimary: account.id === primaryWalletId,
|
|
130
131
|
key: (_a = account.walletName) !== null && _a !== void 0 ? _a : wallet.walletConnector.key,
|
|
131
132
|
});
|
|
132
133
|
}
|
|
@@ -204,6 +204,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
204
204
|
connector: walletOption.walletConnector,
|
|
205
205
|
id: embeddedWalletVerifiedCredential.id,
|
|
206
206
|
isAuthenticated: false,
|
|
207
|
+
isPrimary: true,
|
|
207
208
|
key: (_k = embeddedWalletVerifiedCredential.walletName) !== null && _k !== void 0 ? _k : '',
|
|
208
209
|
});
|
|
209
210
|
setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
|
|
@@ -200,6 +200,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
200
200
|
connector: walletOption.walletConnector,
|
|
201
201
|
id: embeddedWalletVerifiedCredential.id,
|
|
202
202
|
isAuthenticated: false,
|
|
203
|
+
isPrimary: true,
|
|
203
204
|
key: (_k = embeddedWalletVerifiedCredential.walletName) !== null && _k !== void 0 ? _k : '',
|
|
204
205
|
});
|
|
205
206
|
setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
|