@dynamic-labs/sdk-react-core 1.1.0-alpha.3 → 1.1.0-alpha.5
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 +17 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +10 -10
- package/src/index.cjs +16 -0
- package/src/index.d.ts +2 -1
- package/src/index.js +8 -0
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
- package/src/lib/data/api.cjs +15 -0
- package/src/lib/data/api.d.ts +7 -1
- package/src/lib/data/api.js +16 -2
- package/src/lib/events/dynamicEvents.d.ts +2 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +1 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +2 -1
- package/src/lib/locale/en/translation.cjs +71 -1
- package/src/lib/locale/en/translation.d.ts +70 -0
- package/src/lib/locale/en/translation.js +71 -1
- package/src/lib/shared/assets/alt-embedded-wallet.cjs +54 -0
- package/src/lib/shared/assets/alt-embedded-wallet.js +30 -0
- package/src/lib/shared/assets/export-embedded-hero.cjs +90 -0
- package/src/lib/shared/assets/export-embedded-hero.js +66 -0
- package/src/lib/shared/assets/eye-off-icon.cjs +53 -0
- package/src/lib/shared/assets/eye-off-icon.js +29 -0
- package/src/lib/shared/assets/face-id.cjs +53 -0
- package/src/lib/shared/assets/face-id.js +29 -0
- package/src/lib/shared/assets/index.d.ts +6 -0
- package/src/lib/shared/assets/lock.cjs +54 -0
- package/src/lib/shared/assets/lock.js +30 -0
- package/src/lib/shared/assets/wallet-v2.cjs +53 -0
- package/src/lib/shared/assets/wallet-v2.js +29 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/index.d.ts +1 -0
- package/src/lib/utils/functions/isEmailValid/index.d.ts +1 -0
- package/src/lib/utils/functions/isEmailValid/isEmailValid.cjs +8 -0
- package/src/lib/utils/functions/isEmailValid/isEmailValid.d.ts +1 -0
- package/src/lib/utils/functions/isEmailValid/isEmailValid.js +4 -0
- package/src/lib/utils/functions/isProviderEnabled/isProviderEnabled.cjs +9 -1
- package/src/lib/utils/functions/isProviderEnabled/isProviderEnabled.js +9 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +28 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +28 -1
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +4 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +4 -1
- package/src/lib/utils/hooks/useConnectWithEmailOtp/index.d.ts +1 -0
- package/src/lib/utils/hooks/useConnectWithEmailOtp/useConnectWithEmailOtp.cjs +150 -0
- package/src/lib/utils/hooks/useConnectWithEmailOtp/useConnectWithEmailOtp.d.ts +32 -0
- package/src/lib/utils/hooks/useConnectWithEmailOtp/useConnectWithEmailOtp.js +146 -0
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.cjs +3 -3
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.js +3 -3
- package/src/lib/utils/hooks/useEmbeddedReveal/index.d.ts +1 -0
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +60 -0
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.d.ts +4 -0
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +56 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +3 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +3 -0
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs +2 -27
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.js +2 -27
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +20 -14
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +20 -14
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +26 -4
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +26 -4
- package/src/lib/views/EmailVerification/EmailVerification.cjs +34 -23
- package/src/lib/views/EmailVerification/EmailVerification.js +34 -23
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +158 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.d.ts +2 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +154 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/index.d.ts +1 -0
- package/src/lib/views/EmbeddedReveal/constants.cjs +9 -0
- package/src/lib/views/EmbeddedReveal/constants.d.ts +2 -0
- package/src/lib/views/EmbeddedReveal/constants.js +4 -0
- package/src/lib/views/EmbeddedReveal/index.d.ts +1 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/index.d.ts +1 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +114 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.d.ts +15 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +108 -0
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +2 -3
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.d.ts +0 -1
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +3 -3
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +2 -2
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +2 -2
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +2 -2
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.d.ts +2 -2
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +2 -2
- package/src/lib/views/WalletList/WalletList.cjs +5 -8
- package/src/lib/views/WalletList/WalletList.js +5 -8
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.js +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +3 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.js +2 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +4 -4
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.cjs +93 -0
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.js +89 -0
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/index.d.ts +1 -0
|
@@ -24,12 +24,14 @@ import { isTurnkeyEnabled } from '../../functions/isTurnkeyEnabled/isTurnkeyEnab
|
|
|
24
24
|
import { findSmartWallet, initializeSmartWallet } from '../useWalletConnectors/utils/smartWallet/smartWallet.js';
|
|
25
25
|
import { useCreateDynamicEmbeddedWalletMutation } from '../useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js';
|
|
26
26
|
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
27
|
+
import { useCreateUserProfileByJWTCallback } from '../useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js';
|
|
27
28
|
|
|
28
29
|
// Hook exposed to customers and used internally to trigger embedded wallet creation
|
|
29
30
|
const useEmbeddedWallet = () => {
|
|
30
31
|
const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId, walletConnectorOptions, internalSetShowAuthFlow, primaryWallet, environmentId, } = useInternalDynamicContext();
|
|
31
32
|
const { setView } = useViewContext();
|
|
32
33
|
const { createDynamicEmbeddedWalletMutation } = useCreateDynamicEmbeddedWalletMutation();
|
|
34
|
+
const { createUserProfileByJWT } = useCreateUserProfileByJWTCallback();
|
|
33
35
|
const userHasEmbeddedWallet = () => {
|
|
34
36
|
var _a;
|
|
35
37
|
const jwt = (_a = getAuthToken()) !== null && _a !== void 0 ? _a : onboardingOnlyJwt;
|
|
@@ -81,6 +83,7 @@ const useEmbeddedWallet = () => {
|
|
|
81
83
|
// if user already has embedded wallet, set it as primary wallet
|
|
82
84
|
if (decodedJwt) {
|
|
83
85
|
(_a = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _a === void 0 ? void 0 : _a.setVerifiedCredentials(decodedJwt.verifiedCredentials);
|
|
86
|
+
yield createUserProfileByJWT(jwt);
|
|
84
87
|
const smartWallet = findSmartWallet(embeddedWalletVerifiedCredential, decodedJwt.verifiedCredentials);
|
|
85
88
|
if (smartWallet) {
|
|
86
89
|
yield initializeSmartWallet({
|
|
@@ -3,37 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
6
|
-
require('@dynamic-labs/sdk-api');
|
|
7
|
-
require('../../../shared/logger.cjs');
|
|
8
|
-
require('@dynamic-labs/iconic');
|
|
9
|
-
require('@dynamic-labs/wallet-connector-core');
|
|
10
|
-
require('react/jsx-runtime');
|
|
11
|
-
require('../../../context/ViewContext/ViewContext.cjs');
|
|
12
|
-
require('react');
|
|
13
|
-
require('@dynamic-labs/wallet-book');
|
|
14
|
-
require('../../constants/colors.cjs');
|
|
15
|
-
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
16
|
-
require('viem');
|
|
17
|
-
require('@dynamic-labs/utils');
|
|
18
|
-
require('../../../shared/consts/index.cjs');
|
|
19
|
-
require('@dynamic-labs/multi-wallet');
|
|
20
|
-
var isTurnkeyEnabled = require('../../functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs');
|
|
21
6
|
|
|
22
7
|
const useIsLoggedIn = () => {
|
|
23
|
-
const { user, primaryWallet, authMode
|
|
24
|
-
const isTurnkeyProviderEnabled = isTurnkeyEnabled.isTurnkeyEnabled(projectSettings);
|
|
8
|
+
const { user, primaryWallet, authMode } = useInternalDynamicContext.useInternalDynamicContext();
|
|
25
9
|
// a user is set even when on connect-only mode if signing in with social,
|
|
26
10
|
// but it won't have a primaryWallet in this case
|
|
27
|
-
|
|
28
|
-
// if turnkey is enabled we need to check if the user that is logged/connected
|
|
29
|
-
// has a primaryWallet to not show the widget without secure
|
|
30
|
-
if (isTurnkeyProviderEnabled &&
|
|
31
|
-
(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.automaticEmbeddedWalletCreation) &&
|
|
32
|
-
((projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWalletSecurityMethods) || []).length === 0) {
|
|
33
|
-
return Boolean(primaryWallet && isLoggedIn);
|
|
34
|
-
}
|
|
35
|
-
// return isLoggedIn;
|
|
36
|
-
return isLoggedIn;
|
|
11
|
+
return (Boolean(user) || (authMode === 'connect-only' && Boolean(primaryWallet)));
|
|
37
12
|
};
|
|
38
13
|
|
|
39
14
|
exports.useIsLoggedIn = useIsLoggedIn;
|
|
@@ -1,35 +1,10 @@
|
|
|
1
1
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
2
|
-
import '@dynamic-labs/sdk-api';
|
|
3
|
-
import '../../../shared/logger.js';
|
|
4
|
-
import '@dynamic-labs/iconic';
|
|
5
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
6
|
-
import 'react/jsx-runtime';
|
|
7
|
-
import '../../../context/ViewContext/ViewContext.js';
|
|
8
|
-
import 'react';
|
|
9
|
-
import '@dynamic-labs/wallet-book';
|
|
10
|
-
import '../../constants/colors.js';
|
|
11
|
-
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
12
|
-
import 'viem';
|
|
13
|
-
import '@dynamic-labs/utils';
|
|
14
|
-
import '../../../shared/consts/index.js';
|
|
15
|
-
import '@dynamic-labs/multi-wallet';
|
|
16
|
-
import { isTurnkeyEnabled } from '../../functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
17
2
|
|
|
18
3
|
const useIsLoggedIn = () => {
|
|
19
|
-
const { user, primaryWallet, authMode
|
|
20
|
-
const isTurnkeyProviderEnabled = isTurnkeyEnabled(projectSettings);
|
|
4
|
+
const { user, primaryWallet, authMode } = useInternalDynamicContext();
|
|
21
5
|
// a user is set even when on connect-only mode if signing in with social,
|
|
22
6
|
// but it won't have a primaryWallet in this case
|
|
23
|
-
|
|
24
|
-
// if turnkey is enabled we need to check if the user that is logged/connected
|
|
25
|
-
// has a primaryWallet to not show the widget without secure
|
|
26
|
-
if (isTurnkeyProviderEnabled &&
|
|
27
|
-
(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.automaticEmbeddedWalletCreation) &&
|
|
28
|
-
((projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWalletSecurityMethods) || []).length === 0) {
|
|
29
|
-
return Boolean(primaryWallet && isLoggedIn);
|
|
30
|
-
}
|
|
31
|
-
// return isLoggedIn;
|
|
32
|
-
return isLoggedIn;
|
|
7
|
+
return (Boolean(user) || (authMode === 'connect-only' && Boolean(primaryWallet)));
|
|
33
8
|
};
|
|
34
9
|
|
|
35
10
|
export { useIsLoggedIn };
|
|
@@ -27,7 +27,9 @@ require('@dynamic-labs/multi-wallet');
|
|
|
27
27
|
var getAuthToken = require('../../functions/getAuthToken/getAuthToken.cjs');
|
|
28
28
|
var getOauthLoginUrl = require('../../functions/getOauthLoginUrl/getOauthLoginUrl.cjs');
|
|
29
29
|
var getProviderByType = require('../../functions/getProviderByType/getProviderByType.cjs');
|
|
30
|
+
var isTurnkeyEnabled = require('../../functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs');
|
|
30
31
|
var randomString = require('../../functions/randomString/randomString.cjs');
|
|
32
|
+
var index = require('../../functions/storeAuthToken/index.cjs');
|
|
31
33
|
var stringifyURIQuery = require('../../functions/stringifyURIQuery/stringifyURIQuery.cjs');
|
|
32
34
|
var useCreateUserProfileByJWTCallback = require('../useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs');
|
|
33
35
|
var ErrorContext = require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
@@ -58,6 +60,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
|
58
60
|
const { createEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
|
|
59
61
|
const [isProcessing, setIsProcessing] = React.useState(false);
|
|
60
62
|
const [error, setError] = React.useState();
|
|
63
|
+
const isTurnkeyProviderEnabled = isTurnkeyEnabled.isTurnkeyEnabled(projectSettings);
|
|
61
64
|
const providersWaitingOauthMessage = React.useRef({});
|
|
62
65
|
const authWindowInterval = React.useRef();
|
|
63
66
|
const shouldPool = React.useRef(false);
|
|
@@ -147,22 +150,25 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
|
147
150
|
return;
|
|
148
151
|
}
|
|
149
152
|
setCallback('authSuccess');
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
if (isTurnkeyProviderEnabled &&
|
|
154
|
+
((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation)) {
|
|
155
|
+
try {
|
|
156
|
+
index.storeAuthToken(jwt);
|
|
157
|
+
// this function will check turnkey wallet enabled and create wallet if needed
|
|
158
|
+
// if not enabled, it will throw an error.
|
|
159
|
+
yield createEmbeddedWallet();
|
|
160
|
+
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
161
|
+
}
|
|
162
|
+
catch (e) {
|
|
163
|
+
yield createUserProfileByJWT(jwt);
|
|
164
|
+
setShowAuthFlow(false);
|
|
165
|
+
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
166
|
+
}
|
|
154
167
|
return;
|
|
155
168
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
yield createEmbeddedWallet();
|
|
160
|
-
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
161
|
-
}
|
|
162
|
-
catch (e) {
|
|
163
|
-
setShowAuthFlow(false);
|
|
164
|
-
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
165
|
-
}
|
|
169
|
+
yield createUserProfileByJWT(jwt);
|
|
170
|
+
setShowAuthFlow(false);
|
|
171
|
+
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
166
172
|
}
|
|
167
173
|
catch (error) {
|
|
168
174
|
if (error instanceof utils.NoAccessError) {
|
|
@@ -23,7 +23,9 @@ import '@dynamic-labs/multi-wallet';
|
|
|
23
23
|
import { getAuthToken } from '../../functions/getAuthToken/getAuthToken.js';
|
|
24
24
|
import { getOauthLoginUrl } from '../../functions/getOauthLoginUrl/getOauthLoginUrl.js';
|
|
25
25
|
import { getProviderByType } from '../../functions/getProviderByType/getProviderByType.js';
|
|
26
|
+
import { isTurnkeyEnabled } from '../../functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
26
27
|
import { randomString } from '../../functions/randomString/randomString.js';
|
|
28
|
+
import { storeAuthToken } from '../../functions/storeAuthToken/index.js';
|
|
27
29
|
import { stringifyURIQuery } from '../../functions/stringifyURIQuery/stringifyURIQuery.js';
|
|
28
30
|
import { useCreateUserProfileByJWTCallback } from '../useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js';
|
|
29
31
|
import { useErrorContext } from '../../../context/ErrorContext/ErrorContext.js';
|
|
@@ -54,6 +56,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
|
54
56
|
const { createEmbeddedWallet } = useEmbeddedWallet();
|
|
55
57
|
const [isProcessing, setIsProcessing] = useState(false);
|
|
56
58
|
const [error, setError] = useState();
|
|
59
|
+
const isTurnkeyProviderEnabled = isTurnkeyEnabled(projectSettings);
|
|
57
60
|
const providersWaitingOauthMessage = useRef({});
|
|
58
61
|
const authWindowInterval = useRef();
|
|
59
62
|
const shouldPool = useRef(false);
|
|
@@ -143,22 +146,25 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
|
143
146
|
return;
|
|
144
147
|
}
|
|
145
148
|
setCallback('authSuccess');
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
if (isTurnkeyProviderEnabled &&
|
|
150
|
+
((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation)) {
|
|
151
|
+
try {
|
|
152
|
+
storeAuthToken(jwt);
|
|
153
|
+
// this function will check turnkey wallet enabled and create wallet if needed
|
|
154
|
+
// if not enabled, it will throw an error.
|
|
155
|
+
yield createEmbeddedWallet();
|
|
156
|
+
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
157
|
+
}
|
|
158
|
+
catch (e) {
|
|
159
|
+
yield createUserProfileByJWT(jwt);
|
|
160
|
+
setShowAuthFlow(false);
|
|
161
|
+
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
162
|
+
}
|
|
150
163
|
return;
|
|
151
164
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
yield createEmbeddedWallet();
|
|
156
|
-
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
157
|
-
}
|
|
158
|
-
catch (e) {
|
|
159
|
-
setShowAuthFlow(false);
|
|
160
|
-
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
161
|
-
}
|
|
165
|
+
yield createUserProfileByJWT(jwt);
|
|
166
|
+
setShowAuthFlow(false);
|
|
167
|
+
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
162
168
|
}
|
|
163
169
|
catch (error) {
|
|
164
170
|
if (error instanceof NoAccessError) {
|
|
@@ -25,6 +25,8 @@ require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
25
25
|
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
26
26
|
require('@dynamic-labs/multi-wallet');
|
|
27
27
|
require('@dynamic-labs/sdk-api');
|
|
28
|
+
var isTurnkeyEnabled = require('../../../functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs');
|
|
29
|
+
var index = require('../../../functions/storeAuthToken/index.cjs');
|
|
28
30
|
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
29
31
|
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
30
32
|
var useEmailVerificationRequest = require('../../authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs');
|
|
@@ -54,13 +56,14 @@ const userFieldsSchema = yup.object().shape({
|
|
|
54
56
|
username: yup.string(),
|
|
55
57
|
});
|
|
56
58
|
const useUpdateUser = (validationSchemaStripUnknown) => {
|
|
57
|
-
const { authToken, onboardingOnlyJwt, environmentId } = useInternalDynamicContext.useInternalDynamicContext();
|
|
59
|
+
const { authToken, onboardingOnlyJwt, environmentId, projectSettings, primaryWallet, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
60
|
+
const isTurnkeyProviderEnabled = isTurnkeyEnabled.isTurnkeyEnabled(projectSettings);
|
|
58
61
|
const jwtToken = onboardingOnlyJwt || authToken;
|
|
59
62
|
const { setVerificationUUID, setEmail } = EmailVerificationContext.useEmailVerificationContext();
|
|
60
63
|
const { verifyEmail } = useEmailVerificationRequest.useEmailVerificationRequest();
|
|
61
64
|
const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback.useUpdateUserProfileByJWTCallback();
|
|
62
65
|
return React.useCallback((userFields, userEnvironmentId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
-
var _a, _b, _c;
|
|
66
|
+
var _a, _b, _c, _d;
|
|
64
67
|
// `stripUnknown: true` will automatically strip out any values in the metadata object
|
|
65
68
|
// so we need to pull out the metadata object here and then re-add it after stripping unknown fields
|
|
66
69
|
const { metadata } = userFields;
|
|
@@ -72,6 +75,25 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
|
|
|
72
75
|
const decodedJwt = decodeJwt.decodeJwt(updateUserProfileResponse.jwt);
|
|
73
76
|
const missingFields = (_a = decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.missingFields) !== null && _a !== void 0 ? _a : [];
|
|
74
77
|
const _isEmailVerificationRequired = isEmailVerificationRequired.isEmailVerificationRequired(updateUserProfileResponse);
|
|
78
|
+
// This is to handle properly the embedded wallet creation.
|
|
79
|
+
// In that case we shouldn't create a user. Only store the JWT in the localstorage
|
|
80
|
+
// The user will be created after generating the wallet.
|
|
81
|
+
// This should be called only when:
|
|
82
|
+
// Turnkey is enabled
|
|
83
|
+
// automaticEmbeddedWalletCreation is set to true
|
|
84
|
+
// there is no emailVerificationRequired -> it's already verified
|
|
85
|
+
// there is no primaryWallet -> it means that the user is already logged in
|
|
86
|
+
if (isTurnkeyProviderEnabled &&
|
|
87
|
+
((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation) &&
|
|
88
|
+
!_isEmailVerificationRequired &&
|
|
89
|
+
!primaryWallet) {
|
|
90
|
+
index.storeAuthToken(updateUserProfileResponse.jwt);
|
|
91
|
+
return {
|
|
92
|
+
isEmailVerificationRequired: false,
|
|
93
|
+
missingFields,
|
|
94
|
+
updateUserProfileResponse,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
75
97
|
if (!_isEmailVerificationRequired) {
|
|
76
98
|
// If email verification is not needed then we can update the user profile immediately.
|
|
77
99
|
yield updateUserProfileByJWT(updateUserProfileResponse.jwt);
|
|
@@ -82,8 +104,8 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
|
|
|
82
104
|
};
|
|
83
105
|
}
|
|
84
106
|
// We update EmailContext to use this information in the Email Verification view
|
|
85
|
-
setEmail((
|
|
86
|
-
setVerificationUUID((
|
|
107
|
+
setEmail((_c = updateUserProfileResponse.emailVerification) === null || _c === void 0 ? void 0 : _c.email);
|
|
108
|
+
setVerificationUUID((_d = updateUserProfileResponse.emailVerification) === null || _d === void 0 ? void 0 : _d.verificationUUID);
|
|
87
109
|
// DYN-2046 - Customers have the opportunity to programmatically use our email verification and profile editing.
|
|
88
110
|
// VerifyEmailFN was scoped to bypass the problem with memoization of the state at the beginning of Promise.
|
|
89
111
|
// setEmail and setVerificationUUID in the above lines will are not visible in this promise.
|
|
@@ -21,6 +21,8 @@ import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
|
21
21
|
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
22
22
|
import '@dynamic-labs/multi-wallet';
|
|
23
23
|
import '@dynamic-labs/sdk-api';
|
|
24
|
+
import { isTurnkeyEnabled } from '../../../functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
25
|
+
import { storeAuthToken } from '../../../functions/storeAuthToken/index.js';
|
|
24
26
|
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
25
27
|
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
26
28
|
import { useEmailVerificationRequest } from '../../authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js';
|
|
@@ -50,13 +52,14 @@ const userFieldsSchema = object().shape({
|
|
|
50
52
|
username: string(),
|
|
51
53
|
});
|
|
52
54
|
const useUpdateUser = (validationSchemaStripUnknown) => {
|
|
53
|
-
const { authToken, onboardingOnlyJwt, environmentId } = useInternalDynamicContext();
|
|
55
|
+
const { authToken, onboardingOnlyJwt, environmentId, projectSettings, primaryWallet, } = useInternalDynamicContext();
|
|
56
|
+
const isTurnkeyProviderEnabled = isTurnkeyEnabled(projectSettings);
|
|
54
57
|
const jwtToken = onboardingOnlyJwt || authToken;
|
|
55
58
|
const { setVerificationUUID, setEmail } = useEmailVerificationContext();
|
|
56
59
|
const { verifyEmail } = useEmailVerificationRequest();
|
|
57
60
|
const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback();
|
|
58
61
|
return useCallback((userFields, userEnvironmentId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
var _a, _b, _c;
|
|
62
|
+
var _a, _b, _c, _d;
|
|
60
63
|
// `stripUnknown: true` will automatically strip out any values in the metadata object
|
|
61
64
|
// so we need to pull out the metadata object here and then re-add it after stripping unknown fields
|
|
62
65
|
const { metadata } = userFields;
|
|
@@ -68,6 +71,25 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
|
|
|
68
71
|
const decodedJwt = decodeJwt(updateUserProfileResponse.jwt);
|
|
69
72
|
const missingFields = (_a = decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.missingFields) !== null && _a !== void 0 ? _a : [];
|
|
70
73
|
const _isEmailVerificationRequired = isEmailVerificationRequired(updateUserProfileResponse);
|
|
74
|
+
// This is to handle properly the embedded wallet creation.
|
|
75
|
+
// In that case we shouldn't create a user. Only store the JWT in the localstorage
|
|
76
|
+
// The user will be created after generating the wallet.
|
|
77
|
+
// This should be called only when:
|
|
78
|
+
// Turnkey is enabled
|
|
79
|
+
// automaticEmbeddedWalletCreation is set to true
|
|
80
|
+
// there is no emailVerificationRequired -> it's already verified
|
|
81
|
+
// there is no primaryWallet -> it means that the user is already logged in
|
|
82
|
+
if (isTurnkeyProviderEnabled &&
|
|
83
|
+
((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation) &&
|
|
84
|
+
!_isEmailVerificationRequired &&
|
|
85
|
+
!primaryWallet) {
|
|
86
|
+
storeAuthToken(updateUserProfileResponse.jwt);
|
|
87
|
+
return {
|
|
88
|
+
isEmailVerificationRequired: false,
|
|
89
|
+
missingFields,
|
|
90
|
+
updateUserProfileResponse,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
71
93
|
if (!_isEmailVerificationRequired) {
|
|
72
94
|
// If email verification is not needed then we can update the user profile immediately.
|
|
73
95
|
yield updateUserProfileByJWT(updateUserProfileResponse.jwt);
|
|
@@ -78,8 +100,8 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
|
|
|
78
100
|
};
|
|
79
101
|
}
|
|
80
102
|
// We update EmailContext to use this information in the Email Verification view
|
|
81
|
-
setEmail((
|
|
82
|
-
setVerificationUUID((
|
|
103
|
+
setEmail((_c = updateUserProfileResponse.emailVerification) === null || _c === void 0 ? void 0 : _c.email);
|
|
104
|
+
setVerificationUUID((_d = updateUserProfileResponse.emailVerification) === null || _d === void 0 ? void 0 : _d.verificationUUID);
|
|
83
105
|
// DYN-2046 - Customers have the opportunity to programmatically use our email verification and profile editing.
|
|
84
106
|
// VerifyEmailFN was scoped to bypass the problem with memoization of the state at the beginning of Promise.
|
|
85
107
|
// setEmail and setVerificationUUID in the above lines will are not visible in this promise.
|
|
@@ -28,6 +28,8 @@ var useEffectOnce = require('../../shared/utils/hooks/useEffectOnce/useEffectOnc
|
|
|
28
28
|
require('../../shared/consts/index.cjs');
|
|
29
29
|
require('@dynamic-labs/multi-wallet');
|
|
30
30
|
require('@dynamic-labs/sdk-api');
|
|
31
|
+
var isTurnkeyEnabled = require('../../utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs');
|
|
32
|
+
var index = require('../../utils/functions/storeAuthToken/index.cjs');
|
|
31
33
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
32
34
|
var AccountExistsContext = require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
33
35
|
var api = require('../../data/api.cjs');
|
|
@@ -101,6 +103,7 @@ const EmailVerification = () => {
|
|
|
101
103
|
const { loading, setLoading } = LoadingContext.useLoadingContext();
|
|
102
104
|
const { t } = reactI18next.useTranslation();
|
|
103
105
|
const { createEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
|
|
106
|
+
const isTurnkeyProviderEnabled = isTurnkeyEnabled.isTurnkeyEnabled(projectSettings);
|
|
104
107
|
const { remainingSeconds, startCountdown } = useCountdown.useCountdown({
|
|
105
108
|
callback: () => setRetried(false),
|
|
106
109
|
seconds: SECONDS_TO_RETRY,
|
|
@@ -130,7 +133,7 @@ const EmailVerification = () => {
|
|
|
130
133
|
return;
|
|
131
134
|
}
|
|
132
135
|
try {
|
|
133
|
-
const { nextView } = yield verifyEmail(verificationToken, verificationUUID);
|
|
136
|
+
const { nextView, jwt } = yield verifyEmail(verificationToken, verificationUUID);
|
|
134
137
|
if (onboardingOnlyJwt) {
|
|
135
138
|
setOnboardingOnlyJwt(undefined);
|
|
136
139
|
setCallback('authSuccess');
|
|
@@ -139,18 +142,20 @@ const EmailVerification = () => {
|
|
|
139
142
|
if (nextView === 'verified-and-transferred') {
|
|
140
143
|
setShowTransferMessage(true);
|
|
141
144
|
}
|
|
142
|
-
if (
|
|
143
|
-
|
|
145
|
+
if (isTurnkeyProviderEnabled &&
|
|
146
|
+
((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _c === void 0 ? void 0 : _c.automaticEmbeddedWalletCreation)) {
|
|
147
|
+
try {
|
|
148
|
+
index.storeAuthToken(jwt);
|
|
149
|
+
// this function will check turnkey wallet enabled and create wallet if needed
|
|
150
|
+
// if not enabled, it will throw an error.
|
|
151
|
+
yield createEmbeddedWallet();
|
|
152
|
+
}
|
|
153
|
+
catch (e) {
|
|
154
|
+
setShowAuthFlow(false);
|
|
155
|
+
}
|
|
144
156
|
return;
|
|
145
157
|
}
|
|
146
|
-
|
|
147
|
-
// this function will check turnkey wallet enabled and create wallet if needed
|
|
148
|
-
// if not enabled, it will throw an error.
|
|
149
|
-
yield createEmbeddedWallet();
|
|
150
|
-
}
|
|
151
|
-
catch (e) {
|
|
152
|
-
setShowAuthFlow(false);
|
|
153
|
-
}
|
|
158
|
+
setShowAuthFlow(false);
|
|
154
159
|
}
|
|
155
160
|
catch (error) {
|
|
156
161
|
logger.logger.debug(error);
|
|
@@ -178,8 +183,8 @@ const EmailVerification = () => {
|
|
|
178
183
|
(_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation,
|
|
179
184
|
createEmbeddedWallet,
|
|
180
185
|
setShowAuthFlow,
|
|
181
|
-
setErrorMessage,
|
|
182
186
|
setView,
|
|
187
|
+
isTurnkeyProviderEnabled,
|
|
183
188
|
]);
|
|
184
189
|
const handleEmailLogin = React.useCallback((verificationToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
185
190
|
var _d;
|
|
@@ -212,19 +217,24 @@ const EmailVerification = () => {
|
|
|
212
217
|
setCallback('authSuccess');
|
|
213
218
|
// this timeout is set to make sure that the user will see success message
|
|
214
219
|
yield sleepToShowSuccessMessage();
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
220
|
+
if (isTurnkeyProviderEnabled &&
|
|
221
|
+
((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.automaticEmbeddedWalletCreation)) {
|
|
222
|
+
try {
|
|
223
|
+
// Store the auth token in local storage so it can be used during embedded wallet creation
|
|
224
|
+
index.storeAuthToken(jwt);
|
|
225
|
+
// this function will check turnkey wallet enabled and create wallet if needed
|
|
226
|
+
// if not enabled, it will throw an error.
|
|
227
|
+
yield createEmbeddedWallet();
|
|
228
|
+
}
|
|
229
|
+
catch (e) {
|
|
230
|
+
yield createUserProfileByJWT(jwt);
|
|
231
|
+
setShowAuthFlow(false);
|
|
232
|
+
}
|
|
218
233
|
return;
|
|
219
234
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
yield createEmbeddedWallet();
|
|
224
|
-
}
|
|
225
|
-
catch (e) {
|
|
226
|
-
setShowAuthFlow(false);
|
|
227
|
-
}
|
|
235
|
+
// If not creating embedded wallet automatically, create user profile
|
|
236
|
+
yield createUserProfileByJWT(jwt);
|
|
237
|
+
setShowAuthFlow(false);
|
|
228
238
|
}
|
|
229
239
|
catch (error) {
|
|
230
240
|
if (error instanceof utils.NoAccessError) {
|
|
@@ -256,6 +266,7 @@ const EmailVerification = () => {
|
|
|
256
266
|
setShowAuthFlow,
|
|
257
267
|
setErrorMessage,
|
|
258
268
|
setExistentAccountData,
|
|
269
|
+
isTurnkeyProviderEnabled,
|
|
259
270
|
]);
|
|
260
271
|
const handleRetry = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
261
272
|
try {
|
|
@@ -24,6 +24,8 @@ import { useEffectOnce } from '../../shared/utils/hooks/useEffectOnce/useEffectO
|
|
|
24
24
|
import '../../shared/consts/index.js';
|
|
25
25
|
import '@dynamic-labs/multi-wallet';
|
|
26
26
|
import '@dynamic-labs/sdk-api';
|
|
27
|
+
import { isTurnkeyEnabled } from '../../utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
28
|
+
import { storeAuthToken } from '../../utils/functions/storeAuthToken/index.js';
|
|
27
29
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
28
30
|
import { useAccountExistsContext } from '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
29
31
|
import { signInWithEmailVerification, retryEmailVerification } from '../../data/api.js';
|
|
@@ -97,6 +99,7 @@ const EmailVerification = () => {
|
|
|
97
99
|
const { loading, setLoading } = useLoadingContext();
|
|
98
100
|
const { t } = useTranslation();
|
|
99
101
|
const { createEmbeddedWallet } = useEmbeddedWallet();
|
|
102
|
+
const isTurnkeyProviderEnabled = isTurnkeyEnabled(projectSettings);
|
|
100
103
|
const { remainingSeconds, startCountdown } = useCountdown({
|
|
101
104
|
callback: () => setRetried(false),
|
|
102
105
|
seconds: SECONDS_TO_RETRY,
|
|
@@ -126,7 +129,7 @@ const EmailVerification = () => {
|
|
|
126
129
|
return;
|
|
127
130
|
}
|
|
128
131
|
try {
|
|
129
|
-
const { nextView } = yield verifyEmail(verificationToken, verificationUUID);
|
|
132
|
+
const { nextView, jwt } = yield verifyEmail(verificationToken, verificationUUID);
|
|
130
133
|
if (onboardingOnlyJwt) {
|
|
131
134
|
setOnboardingOnlyJwt(undefined);
|
|
132
135
|
setCallback('authSuccess');
|
|
@@ -135,18 +138,20 @@ const EmailVerification = () => {
|
|
|
135
138
|
if (nextView === 'verified-and-transferred') {
|
|
136
139
|
setShowTransferMessage(true);
|
|
137
140
|
}
|
|
138
|
-
if (
|
|
139
|
-
|
|
141
|
+
if (isTurnkeyProviderEnabled &&
|
|
142
|
+
((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _c === void 0 ? void 0 : _c.automaticEmbeddedWalletCreation)) {
|
|
143
|
+
try {
|
|
144
|
+
storeAuthToken(jwt);
|
|
145
|
+
// this function will check turnkey wallet enabled and create wallet if needed
|
|
146
|
+
// if not enabled, it will throw an error.
|
|
147
|
+
yield createEmbeddedWallet();
|
|
148
|
+
}
|
|
149
|
+
catch (e) {
|
|
150
|
+
setShowAuthFlow(false);
|
|
151
|
+
}
|
|
140
152
|
return;
|
|
141
153
|
}
|
|
142
|
-
|
|
143
|
-
// this function will check turnkey wallet enabled and create wallet if needed
|
|
144
|
-
// if not enabled, it will throw an error.
|
|
145
|
-
yield createEmbeddedWallet();
|
|
146
|
-
}
|
|
147
|
-
catch (e) {
|
|
148
|
-
setShowAuthFlow(false);
|
|
149
|
-
}
|
|
154
|
+
setShowAuthFlow(false);
|
|
150
155
|
}
|
|
151
156
|
catch (error) {
|
|
152
157
|
logger.debug(error);
|
|
@@ -174,8 +179,8 @@ const EmailVerification = () => {
|
|
|
174
179
|
(_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation,
|
|
175
180
|
createEmbeddedWallet,
|
|
176
181
|
setShowAuthFlow,
|
|
177
|
-
setErrorMessage,
|
|
178
182
|
setView,
|
|
183
|
+
isTurnkeyProviderEnabled,
|
|
179
184
|
]);
|
|
180
185
|
const handleEmailLogin = useCallback((verificationToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
181
186
|
var _d;
|
|
@@ -208,19 +213,24 @@ const EmailVerification = () => {
|
|
|
208
213
|
setCallback('authSuccess');
|
|
209
214
|
// this timeout is set to make sure that the user will see success message
|
|
210
215
|
yield sleepToShowSuccessMessage();
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
216
|
+
if (isTurnkeyProviderEnabled &&
|
|
217
|
+
((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.automaticEmbeddedWalletCreation)) {
|
|
218
|
+
try {
|
|
219
|
+
// Store the auth token in local storage so it can be used during embedded wallet creation
|
|
220
|
+
storeAuthToken(jwt);
|
|
221
|
+
// this function will check turnkey wallet enabled and create wallet if needed
|
|
222
|
+
// if not enabled, it will throw an error.
|
|
223
|
+
yield createEmbeddedWallet();
|
|
224
|
+
}
|
|
225
|
+
catch (e) {
|
|
226
|
+
yield createUserProfileByJWT(jwt);
|
|
227
|
+
setShowAuthFlow(false);
|
|
228
|
+
}
|
|
214
229
|
return;
|
|
215
230
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
yield createEmbeddedWallet();
|
|
220
|
-
}
|
|
221
|
-
catch (e) {
|
|
222
|
-
setShowAuthFlow(false);
|
|
223
|
-
}
|
|
231
|
+
// If not creating embedded wallet automatically, create user profile
|
|
232
|
+
yield createUserProfileByJWT(jwt);
|
|
233
|
+
setShowAuthFlow(false);
|
|
224
234
|
}
|
|
225
235
|
catch (error) {
|
|
226
236
|
if (error instanceof NoAccessError) {
|
|
@@ -252,6 +262,7 @@ const EmailVerification = () => {
|
|
|
252
262
|
setShowAuthFlow,
|
|
253
263
|
setErrorMessage,
|
|
254
264
|
setExistentAccountData,
|
|
265
|
+
isTurnkeyProviderEnabled,
|
|
255
266
|
]);
|
|
256
267
|
const handleRetry = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
257
268
|
try {
|