@dynamic-labs/sdk-react-core 2.1.0-alpha.17 → 2.1.0-alpha.19
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 +18 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +13 -13
- package/src/lib/components/MfaRecoveryIcon/MfaRecoveryIcon.cjs +15 -0
- package/src/lib/components/MfaRecoveryIcon/MfaRecoveryIcon.d.ts +2 -0
- package/src/lib/components/MfaRecoveryIcon/MfaRecoveryIcon.js +11 -0
- package/src/lib/components/MfaRecoveryIcon/index.d.ts +1 -0
- package/src/lib/components/Portal/Portal.cjs +0 -1
- package/src/lib/components/Portal/Portal.js +0 -1
- package/src/lib/components/SocialSignIn/SocialSignIn.cjs +5 -2
- package/src/lib/components/SocialSignIn/SocialSignIn.js +5 -2
- package/src/lib/components/SyncEmbeddedWalletAuthFlow/SyncEmbeddedWalletAuthFlow.cjs +16 -28
- package/src/lib/components/SyncEmbeddedWalletAuthFlow/SyncEmbeddedWalletAuthFlow.js +16 -28
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.d.ts +1 -1
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +1 -1
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +4 -5
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.d.ts +3 -2
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +4 -5
- package/src/lib/context/PasskeyContext/PasskeyContext.cjs +1 -1
- package/src/lib/context/PasskeyContext/PasskeyContext.js +2 -2
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/data/api/api.cjs +2 -2
- package/src/lib/data/api/api.js +2 -2
- package/src/lib/data/api/user/user.cjs +3 -0
- package/src/lib/data/api/user/user.js +4 -1
- package/src/lib/locale/en/translation.cjs +38 -21
- package/src/lib/locale/en/translation.d.ts +38 -21
- package/src/lib/locale/en/translation.js +38 -21
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.cjs +19 -2
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.js +19 -2
- package/src/lib/shared/assets/index.d.ts +1 -0
- package/src/lib/shared/assets/mfa-recovery-icon.cjs +54 -0
- package/src/lib/shared/assets/mfa-recovery-icon.js +30 -0
- package/src/lib/shared/utils/functions/lastAuthenticatedAccount/index.d.ts +2 -2
- package/src/lib/shared/utils/functions/wallet/createWallet.d.ts +4 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/createUserProfile/createUserProfile.cjs +1 -1
- package/src/lib/utils/functions/createUserProfile/createUserProfile.d.ts +2 -1
- package/src/lib/utils/functions/createUserProfile/createUserProfile.js +1 -1
- package/src/lib/utils/functions/getEnabledSocialSignInProvidersAsProviderEnum/getEnabledSocialSignInProvidersAsProviderEnum.cjs +21 -0
- package/src/lib/utils/functions/getEnabledSocialSignInProvidersAsProviderEnum/getEnabledSocialSignInProvidersAsProviderEnum.js +17 -0
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.cjs +6 -3
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.d.ts +2 -1
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.js +7 -4
- package/src/lib/utils/functions/validateMfaRecoveryCode/index.d.ts +1 -0
- package/src/lib/utils/functions/validateMfaRecoveryCode/validateMfaRecoveryCode.cjs +11 -0
- package/src/lib/utils/functions/validateMfaRecoveryCode/validateMfaRecoveryCode.d.ts +1 -0
- package/src/lib/utils/functions/validateMfaRecoveryCode/validateMfaRecoveryCode.js +7 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +5 -3
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +5 -3
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +8 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +8 -0
- package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.cjs +10 -1
- package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.d.ts +5 -0
- package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.js +10 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +21 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +1 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +21 -1
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.cjs +1 -0
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.js +1 -0
- package/src/lib/utils/hooks/useMfaModals/index.d.ts +1 -0
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.cjs +131 -0
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.d.ts +8 -0
- package/src/lib/utils/hooks/useMfaModals/useMfaModals.js +127 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +24 -3
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +1 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +24 -3
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +8 -4
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.d.ts +3 -3
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +8 -4
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +42 -35
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +43 -36
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +7 -2
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +7 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +1 -10
- package/src/lib/views/EmailVerification/EmailVerification.js +1 -10
- package/src/lib/views/FarcasterQrCodeView/FarcasterQrCodeView.cjs +1 -1
- package/src/lib/views/FarcasterQrCodeView/FarcasterQrCodeView.js +1 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +5 -2
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +5 -2
- package/src/lib/views/MfaRecoveryView/MfaRecoveryView.cjs +116 -0
- package/src/lib/views/MfaRecoveryView/MfaRecoveryView.d.ts +2 -0
- package/src/lib/views/MfaRecoveryView/MfaRecoveryView.js +112 -0
- package/src/lib/views/MfaRecoveryView/index.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.cjs +2 -2
- package/src/lib/views/viewToComponentMap.d.ts +2 -2
- package/src/lib/views/viewToComponentMap.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.cjs +5 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.js +5 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +3 -3
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +0 -131
- package/src/lib/views/EmailUpdate/EmailUpdate.d.ts +0 -2
- package/src/lib/views/EmailUpdate/EmailUpdate.js +0 -127
- package/src/lib/views/EmailUpdate/index.d.ts +0 -1
|
@@ -101,7 +101,7 @@ const userFieldsSchema = yup.object().shape({
|
|
|
101
101
|
username: yup.string(),
|
|
102
102
|
});
|
|
103
103
|
const useUpdateUser = (validationSchemaStripUnknown) => {
|
|
104
|
-
const { minAuthToken, onboardingOnlyJwt, environmentId } = useInternalDynamicContext.useInternalDynamicContext();
|
|
104
|
+
const { minAuthToken, onboardingOnlyJwt, environmentId, decodedOnboardingOnlyToken, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
105
105
|
const jwtToken = onboardingOnlyJwt || minAuthToken;
|
|
106
106
|
const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback.useUpdateUserProfileByJWTCallback();
|
|
107
107
|
const { setRetryData } = VerificationContext.useVerification();
|
|
@@ -110,7 +110,11 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
|
|
|
110
110
|
var _a, _b;
|
|
111
111
|
// `stripUnknown: true` will automatically strip out any values in the metadata object
|
|
112
112
|
// so we need to pull out the metadata object here and then re-add it after stripping unknown fields
|
|
113
|
-
|
|
113
|
+
let { metadata } = userFields;
|
|
114
|
+
// when a user has already logged in but a custom field was added to env, in order to not clear the old fields
|
|
115
|
+
metadata = metadata
|
|
116
|
+
? Object.assign(Object.assign({}, decodedOnboardingOnlyToken === null || decodedOnboardingOnlyToken === void 0 ? void 0 : decodedOnboardingOnlyToken.metadata), metadata) : decodedOnboardingOnlyToken === null || decodedOnboardingOnlyToken === void 0 ? void 0 : decodedOnboardingOnlyToken.metadata;
|
|
117
|
+
// we dont add user.metadata from edit profile because it is already in the metadata request for updateUser
|
|
114
118
|
const validatedUserFields = yield userFieldsSchema.validate(userFields, {
|
|
115
119
|
stripUnknown: validationSchemaStripUnknown,
|
|
116
120
|
});
|
|
@@ -150,6 +154,7 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
|
|
|
150
154
|
environmentId,
|
|
151
155
|
updateUserProfileByJWT,
|
|
152
156
|
setRetryData,
|
|
157
|
+
decodedOnboardingOnlyToken,
|
|
153
158
|
]);
|
|
154
159
|
// This is necessary to avoid a circular declaration issue
|
|
155
160
|
const handleVerificationRequired = React.useRef(undefined);
|
|
@@ -97,7 +97,7 @@ const userFieldsSchema = object().shape({
|
|
|
97
97
|
username: string(),
|
|
98
98
|
});
|
|
99
99
|
const useUpdateUser = (validationSchemaStripUnknown) => {
|
|
100
|
-
const { minAuthToken, onboardingOnlyJwt, environmentId } = useInternalDynamicContext();
|
|
100
|
+
const { minAuthToken, onboardingOnlyJwt, environmentId, decodedOnboardingOnlyToken, } = useInternalDynamicContext();
|
|
101
101
|
const jwtToken = onboardingOnlyJwt || minAuthToken;
|
|
102
102
|
const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback();
|
|
103
103
|
const { setRetryData } = useVerification();
|
|
@@ -106,7 +106,11 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
|
|
|
106
106
|
var _a, _b;
|
|
107
107
|
// `stripUnknown: true` will automatically strip out any values in the metadata object
|
|
108
108
|
// so we need to pull out the metadata object here and then re-add it after stripping unknown fields
|
|
109
|
-
|
|
109
|
+
let { metadata } = userFields;
|
|
110
|
+
// when a user has already logged in but a custom field was added to env, in order to not clear the old fields
|
|
111
|
+
metadata = metadata
|
|
112
|
+
? Object.assign(Object.assign({}, decodedOnboardingOnlyToken === null || decodedOnboardingOnlyToken === void 0 ? void 0 : decodedOnboardingOnlyToken.metadata), metadata) : decodedOnboardingOnlyToken === null || decodedOnboardingOnlyToken === void 0 ? void 0 : decodedOnboardingOnlyToken.metadata;
|
|
113
|
+
// we dont add user.metadata from edit profile because it is already in the metadata request for updateUser
|
|
110
114
|
const validatedUserFields = yield userFieldsSchema.validate(userFields, {
|
|
111
115
|
stripUnknown: validationSchemaStripUnknown,
|
|
112
116
|
});
|
|
@@ -146,6 +150,7 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
|
|
|
146
150
|
environmentId,
|
|
147
151
|
updateUserProfileByJWT,
|
|
148
152
|
setRetryData,
|
|
153
|
+
decodedOnboardingOnlyToken,
|
|
149
154
|
]);
|
|
150
155
|
// This is necessary to avoid a circular declaration issue
|
|
151
156
|
const handleVerificationRequired = useRef(undefined);
|
|
@@ -282,22 +282,13 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
282
282
|
setLoading(false);
|
|
283
283
|
}
|
|
284
284
|
});
|
|
285
|
-
// Go to update email screen, but prevent onEmailVerificationX callback from being called
|
|
286
|
-
const updateEmail = () => {
|
|
287
|
-
callCallbackOnUnmount.current = false;
|
|
288
|
-
if (isEmailRecoveryFlow) {
|
|
289
|
-
setView('passkey-recovery-add-email');
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
setView('update-email');
|
|
293
|
-
};
|
|
294
285
|
const EmailIcon = React.useMemo(() => {
|
|
295
286
|
const EmailIcon = (props) => (jsxRuntime.jsx(Icon.Icon, { color: 'brand-primary', children: jsxRuntime.jsx(signInWithEmail.ReactComponent, Object.assign({}, props)) }));
|
|
296
287
|
return EmailIcon;
|
|
297
288
|
}, []);
|
|
298
289
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [error && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { withIcon: false, className: 'email-verification__error-message', children: error })), jsxRuntime.jsxs("div", { className: classNames.classNames('email-verification__container', {
|
|
299
290
|
'email-verification__container--error': Boolean(error),
|
|
300
|
-
}), children: [showTransferMessage && (jsxRuntime.jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), isValidated ? (jsxRuntime.jsx("div", { className: 'email-verification__icon-container', children: jsxRuntime.jsx(IconWithStatus.IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: check.ReactComponent }) })) : (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxRuntime.jsxs("div", { className: 'email-verification__copy-text-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail.shortenEmail(email$1) })] }),
|
|
291
|
+
}), children: [showTransferMessage && (jsxRuntime.jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), isValidated ? (jsxRuntime.jsx("div", { className: 'email-verification__icon-container', children: jsxRuntime.jsx(IconWithStatus.IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: check.ReactComponent }) })) : (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxRuntime.jsxs("div", { className: 'email-verification__copy-text-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail.shortenEmail(email$1) })] }), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: isLoginView ? handleEmailLogin : handleComplete, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsxRuntime.jsx(RetrySendVerificationCodeSection.RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), !isLoginView && !isEmailRecoveryFlow && (jsxRuntime.jsx(TextButton.TextButton, { className: 'email-verification__log-out', onClick: handleLogOut, copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
|
|
301
292
|
};
|
|
302
293
|
|
|
303
294
|
exports.EmailVerification = EmailVerification;
|
|
@@ -278,22 +278,13 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
278
278
|
setLoading(false);
|
|
279
279
|
}
|
|
280
280
|
});
|
|
281
|
-
// Go to update email screen, but prevent onEmailVerificationX callback from being called
|
|
282
|
-
const updateEmail = () => {
|
|
283
|
-
callCallbackOnUnmount.current = false;
|
|
284
|
-
if (isEmailRecoveryFlow) {
|
|
285
|
-
setView('passkey-recovery-add-email');
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
setView('update-email');
|
|
289
|
-
};
|
|
290
281
|
const EmailIcon = useMemo(() => {
|
|
291
282
|
const EmailIcon = (props) => (jsx(Icon, { color: 'brand-primary', children: jsx(SvgSignInWithEmail, Object.assign({}, props)) }));
|
|
292
283
|
return EmailIcon;
|
|
293
284
|
}, []);
|
|
294
285
|
return (jsxs(Fragment, { children: [error && (jsx(ErrorContainer, { withIcon: false, className: 'email-verification__error-message', children: error })), jsxs("div", { className: classNames('email-verification__container', {
|
|
295
286
|
'email-verification__container--error': Boolean(error),
|
|
296
|
-
}), children: [showTransferMessage && (jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), isValidated ? (jsx("div", { className: 'email-verification__icon-container', children: jsx(IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: SvgCheck }) })) : (jsx(IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxs("div", { className: 'email-verification__copy-text-container', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail(email) })] }),
|
|
287
|
+
}), children: [showTransferMessage && (jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), isValidated ? (jsx("div", { className: 'email-verification__icon-container', children: jsx(IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: SvgCheck }) })) : (jsx(IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxs("div", { className: 'email-verification__copy-text-container', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail(email) })] }), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: isLoginView ? handleEmailLogin : handleComplete, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsx(RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), !isLoginView && !isEmailRecoveryFlow && (jsx(TextButton, { className: 'email-verification__log-out', onClick: handleLogOut, copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
|
|
297
288
|
};
|
|
298
289
|
|
|
299
290
|
export { EmailVerification };
|
|
@@ -29,13 +29,13 @@ const FarcasterQrCodeView = () => {
|
|
|
29
29
|
const { setError } = ErrorContext.useErrorContext();
|
|
30
30
|
const [url, setUrl] = React.useState(undefined);
|
|
31
31
|
const { connectSocialAccount } = useSocialAuth.useSocialAuth({
|
|
32
|
-
authMode: 'signin',
|
|
33
32
|
onError: () => setError('Something went wrong'),
|
|
34
33
|
onFarcasterUrl: (url) => setUrl(url),
|
|
35
34
|
sessionTimeout: 10000,
|
|
36
35
|
});
|
|
37
36
|
useEffectOnce.useEffectOnce(() => {
|
|
38
37
|
connectSocialAccount({
|
|
38
|
+
authMode: 'signin',
|
|
39
39
|
provider: sdkApiCore.ProviderEnum.Farcaster,
|
|
40
40
|
});
|
|
41
41
|
});
|
|
@@ -25,13 +25,13 @@ const FarcasterQrCodeView = () => {
|
|
|
25
25
|
const { setError } = useErrorContext();
|
|
26
26
|
const [url, setUrl] = useState(undefined);
|
|
27
27
|
const { connectSocialAccount } = useSocialAuth({
|
|
28
|
-
authMode: 'signin',
|
|
29
28
|
onError: () => setError('Something went wrong'),
|
|
30
29
|
onFarcasterUrl: (url) => setUrl(url),
|
|
31
30
|
sessionTimeout: 10000,
|
|
32
31
|
});
|
|
33
32
|
useEffectOnce(() => {
|
|
34
33
|
connectSocialAccount({
|
|
34
|
+
authMode: 'signin',
|
|
35
35
|
provider: ProviderEnum.Farcaster,
|
|
36
36
|
});
|
|
37
37
|
});
|
|
@@ -83,7 +83,6 @@ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLa
|
|
|
83
83
|
const { setView, goToInitialView } = ViewContext.useViewContext();
|
|
84
84
|
const { engageCaptcha } = CaptchaContext.useCaptchaContext();
|
|
85
85
|
const { isProcessing, connectSocialAccount } = useSocialAuth.useSocialAuth({
|
|
86
|
-
authMode: 'signin',
|
|
87
86
|
onError: () => {
|
|
88
87
|
goToInitialView();
|
|
89
88
|
},
|
|
@@ -104,6 +103,7 @@ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLa
|
|
|
104
103
|
setView('social-redirect-view');
|
|
105
104
|
setShowAuthFlow(true);
|
|
106
105
|
connectSocialAccount({
|
|
106
|
+
authMode: 'signin',
|
|
107
107
|
captchaToken,
|
|
108
108
|
provider: providerEnum,
|
|
109
109
|
});
|
|
@@ -113,7 +113,10 @@ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLa
|
|
|
113
113
|
}
|
|
114
114
|
setView('social-redirect-view');
|
|
115
115
|
setShowAuthFlow(true);
|
|
116
|
-
connectSocialAccount({
|
|
116
|
+
connectSocialAccount({
|
|
117
|
+
authMode: 'signin',
|
|
118
|
+
provider: providerEnum,
|
|
119
|
+
});
|
|
117
120
|
};
|
|
118
121
|
return (jsxRuntime.jsx(SocialSignIn.SocialSignIn, { onSelectProvider: onSelectProvider, providers: enabledSocialProviders, selectedProvider: socialProvider, isLoading: isProcessing, testId: 'dynamic-social-sign-in', defaultProvider: defaultProvider, numOfItemsToDisplay: numOfItemsToDisplay, collapsedLayout: collapsedLayout }));
|
|
119
122
|
};
|
|
@@ -79,7 +79,6 @@ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLa
|
|
|
79
79
|
const { setView, goToInitialView } = useViewContext();
|
|
80
80
|
const { engageCaptcha } = useCaptchaContext();
|
|
81
81
|
const { isProcessing, connectSocialAccount } = useSocialAuth({
|
|
82
|
-
authMode: 'signin',
|
|
83
82
|
onError: () => {
|
|
84
83
|
goToInitialView();
|
|
85
84
|
},
|
|
@@ -100,6 +99,7 @@ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLa
|
|
|
100
99
|
setView('social-redirect-view');
|
|
101
100
|
setShowAuthFlow(true);
|
|
102
101
|
connectSocialAccount({
|
|
102
|
+
authMode: 'signin',
|
|
103
103
|
captchaToken,
|
|
104
104
|
provider: providerEnum,
|
|
105
105
|
});
|
|
@@ -109,7 +109,10 @@ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLa
|
|
|
109
109
|
}
|
|
110
110
|
setView('social-redirect-view');
|
|
111
111
|
setShowAuthFlow(true);
|
|
112
|
-
connectSocialAccount({
|
|
112
|
+
connectSocialAccount({
|
|
113
|
+
authMode: 'signin',
|
|
114
|
+
provider: providerEnum,
|
|
115
|
+
});
|
|
113
116
|
};
|
|
114
117
|
return (jsx(SocialSignIn, { onSelectProvider: onSelectProvider, providers: enabledSocialProviders, selectedProvider: socialProvider, isLoading: isProcessing, testId: 'dynamic-social-sign-in', defaultProvider: defaultProvider, numOfItemsToDisplay: numOfItemsToDisplay, collapsedLayout: collapsedLayout }));
|
|
115
118
|
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
var React = require('react');
|
|
9
|
+
var reactI18next = require('react-i18next');
|
|
10
|
+
require('../../events/dynamicEvents.cjs');
|
|
11
|
+
require('@dynamic-labs/utils');
|
|
12
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
13
|
+
require('@dynamic-labs/sdk-api-core');
|
|
14
|
+
require('../../shared/logger.cjs');
|
|
15
|
+
require('@dynamic-labs/iconic');
|
|
16
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
17
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
18
|
+
require('@dynamic-labs/wallet-book');
|
|
19
|
+
require('../../utils/constants/colors.cjs');
|
|
20
|
+
require('../../utils/constants/values.cjs');
|
|
21
|
+
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
22
|
+
require('../../shared/consts/index.cjs');
|
|
23
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
24
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
25
|
+
require('@dynamic-labs/multi-wallet');
|
|
26
|
+
require('react-international-phone');
|
|
27
|
+
require('viem');
|
|
28
|
+
require('viem/chains');
|
|
29
|
+
require('../../config/ApiEndpoint.cjs');
|
|
30
|
+
require('../../locale/locale.cjs');
|
|
31
|
+
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
32
|
+
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
33
|
+
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
34
|
+
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
35
|
+
require('react-dom');
|
|
36
|
+
require('../../context/WalletContext/WalletContext.cjs');
|
|
37
|
+
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
38
|
+
require('@dynamic-labs/types');
|
|
39
|
+
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
40
|
+
require('yup');
|
|
41
|
+
require('../../context/MockContext/MockContext.cjs');
|
|
42
|
+
require('../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
43
|
+
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
44
|
+
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
45
|
+
require('@dynamic-labs/rpc-providers');
|
|
46
|
+
var Typography = require('../../components/Typography/Typography.cjs');
|
|
47
|
+
require('../../context/FooterAnimationContext/index.cjs');
|
|
48
|
+
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
49
|
+
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
50
|
+
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
51
|
+
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
52
|
+
require('../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
53
|
+
require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
54
|
+
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
55
|
+
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
56
|
+
require('react-focus-lock');
|
|
57
|
+
var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
|
|
58
|
+
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
59
|
+
require('../../components/IconButton/IconButton.cjs');
|
|
60
|
+
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
61
|
+
var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
|
|
62
|
+
require('formik');
|
|
63
|
+
var Button = require('../../components/Button/Button.cjs');
|
|
64
|
+
require('../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
65
|
+
require('../../components/Alert/Alert.cjs');
|
|
66
|
+
var Input = require('../../components/Input/Input.cjs');
|
|
67
|
+
require('../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
68
|
+
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
69
|
+
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
70
|
+
var useMfa = require('../../utils/hooks/useMfa/useMfa.cjs');
|
|
71
|
+
var MfaRecoveryIcon = require('../../components/MfaRecoveryIcon/MfaRecoveryIcon.cjs');
|
|
72
|
+
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
73
|
+
require('../../components/IsBrowser/IsBrowser.cjs');
|
|
74
|
+
require('../../components/Popper/Popper/Popper.cjs');
|
|
75
|
+
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
76
|
+
require('qrcode');
|
|
77
|
+
require('../WalletList/WalletList.cjs');
|
|
78
|
+
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
79
|
+
require('@hcaptcha/react-hcaptcha');
|
|
80
|
+
require('../LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs');
|
|
81
|
+
var validateMfaRecoveryCode = require('../../utils/functions/validateMfaRecoveryCode/validateMfaRecoveryCode.cjs');
|
|
82
|
+
|
|
83
|
+
const MfaRecoveryView = () => {
|
|
84
|
+
const { t } = reactI18next.useTranslation();
|
|
85
|
+
const { authRecoveryCode } = useMfa.useMfa();
|
|
86
|
+
const [code, setCode] = React.useState('');
|
|
87
|
+
const [isValid, setIsValid] = React.useState(false);
|
|
88
|
+
const [error, setError] = React.useState('');
|
|
89
|
+
const openHelp = () => undefined;
|
|
90
|
+
const handleRecovery = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
91
|
+
if (!code) {
|
|
92
|
+
setIsValid(false);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
yield authRecoveryCode(code);
|
|
97
|
+
}
|
|
98
|
+
catch (e) {
|
|
99
|
+
setError(e.message || 'Something went wrong');
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const handleCodeChanged = (event) => {
|
|
103
|
+
const inputCode = event.target.value;
|
|
104
|
+
setCode(inputCode);
|
|
105
|
+
if (validateMfaRecoveryCode.validateMfaRecoveryCode(inputCode)) {
|
|
106
|
+
setIsValid(true);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
setIsValid(false);
|
|
110
|
+
setError('');
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
return (jsxRuntime.jsxs("div", { className: 'mfa-recovery-view', children: [error && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }), !error && !isValid && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: MfaRecoveryIcon.MfaRecoveryScreenIcon, isSpinning: !error && !isValid, iconSize: 96 })), jsxRuntime.jsx("div", { className: 'mfa-recovery-view__body', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: t('dyn_mfa.recovery_view.body') }) }), jsxRuntime.jsxs("div", { className: 'mfa-recovery-view__actions', children: [jsxRuntime.jsx(Input.Input, { id: 'mfa-recovery-input', "data-testid": 'mfa-recovery-input', label: t('dyn_mfa.recovery_view.input_label'), onChange: handleCodeChanged, value: code }), jsxRuntime.jsx(Button.Button, { expanded: true, buttonVariant: 'brand-primary', disabled: !isValid, onClick: handleRecovery, dataTestId: 'mfa-recovery-submit', children: jsxRuntime.jsx(Typography.Typography, { children: t('dyn_mfa.recovery_view.button_label') }) })] }), jsxRuntime.jsxs("div", { className: 'mfa-recovery-view__get-help', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: t('dyn_mfa.recovery_view.get_help.description') }), jsxRuntime.jsx("button", { onClick: openHelp, children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'link', children: t('dyn_mfa.recovery_view.get_help.button_label') }) })] })] }));
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
exports.MfaRecoveryView = MfaRecoveryView;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import '../../events/dynamicEvents.js';
|
|
7
|
+
import '@dynamic-labs/utils';
|
|
8
|
+
import '../../context/DynamicContext/DynamicContext.js';
|
|
9
|
+
import '@dynamic-labs/sdk-api-core';
|
|
10
|
+
import '../../shared/logger.js';
|
|
11
|
+
import '@dynamic-labs/iconic';
|
|
12
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
13
|
+
import '../../context/ViewContext/ViewContext.js';
|
|
14
|
+
import '@dynamic-labs/wallet-book';
|
|
15
|
+
import '../../utils/constants/colors.js';
|
|
16
|
+
import '../../utils/constants/values.js';
|
|
17
|
+
import '../../shared/utils/classes/storage/localStorage.js';
|
|
18
|
+
import '../../shared/consts/index.js';
|
|
19
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
20
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
21
|
+
import '@dynamic-labs/multi-wallet';
|
|
22
|
+
import 'react-international-phone';
|
|
23
|
+
import 'viem';
|
|
24
|
+
import 'viem/chains';
|
|
25
|
+
import '../../config/ApiEndpoint.js';
|
|
26
|
+
import '../../locale/locale.js';
|
|
27
|
+
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
28
|
+
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
29
|
+
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
30
|
+
import '../../context/VerificationContext/VerificationContext.js';
|
|
31
|
+
import 'react-dom';
|
|
32
|
+
import '../../context/WalletContext/WalletContext.js';
|
|
33
|
+
import '../../context/ThemeContext/ThemeContext.js';
|
|
34
|
+
import '@dynamic-labs/types';
|
|
35
|
+
import '../../context/LoadingContext/LoadingContext.js';
|
|
36
|
+
import 'yup';
|
|
37
|
+
import '../../context/MockContext/MockContext.js';
|
|
38
|
+
import '../../context/FieldsStateContext/FieldsStateContext.js';
|
|
39
|
+
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
40
|
+
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
41
|
+
import '@dynamic-labs/rpc-providers';
|
|
42
|
+
import { Typography } from '../../components/Typography/Typography.js';
|
|
43
|
+
import '../../context/FooterAnimationContext/index.js';
|
|
44
|
+
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
45
|
+
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
46
|
+
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
47
|
+
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
48
|
+
import '../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.js';
|
|
49
|
+
import '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
50
|
+
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
51
|
+
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
52
|
+
import 'react-focus-lock';
|
|
53
|
+
import { IconWithSpinner } from '../../components/IconWithSpinner/IconWithSpinner.js';
|
|
54
|
+
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
55
|
+
import '../../components/IconButton/IconButton.js';
|
|
56
|
+
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
57
|
+
import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
|
|
58
|
+
import 'formik';
|
|
59
|
+
import { Button } from '../../components/Button/Button.js';
|
|
60
|
+
import '../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
61
|
+
import '../../components/Alert/Alert.js';
|
|
62
|
+
import { Input } from '../../components/Input/Input.js';
|
|
63
|
+
import '../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
64
|
+
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
65
|
+
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
66
|
+
import { useMfa } from '../../utils/hooks/useMfa/useMfa.js';
|
|
67
|
+
import { MfaRecoveryScreenIcon } from '../../components/MfaRecoveryIcon/MfaRecoveryIcon.js';
|
|
68
|
+
import '../../components/InlineWidget/InlineWidget.js';
|
|
69
|
+
import '../../components/IsBrowser/IsBrowser.js';
|
|
70
|
+
import '../../components/Popper/Popper/Popper.js';
|
|
71
|
+
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
72
|
+
import 'qrcode';
|
|
73
|
+
import '../WalletList/WalletList.js';
|
|
74
|
+
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
75
|
+
import '@hcaptcha/react-hcaptcha';
|
|
76
|
+
import '../LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js';
|
|
77
|
+
import { validateMfaRecoveryCode } from '../../utils/functions/validateMfaRecoveryCode/validateMfaRecoveryCode.js';
|
|
78
|
+
|
|
79
|
+
const MfaRecoveryView = () => {
|
|
80
|
+
const { t } = useTranslation();
|
|
81
|
+
const { authRecoveryCode } = useMfa();
|
|
82
|
+
const [code, setCode] = useState('');
|
|
83
|
+
const [isValid, setIsValid] = useState(false);
|
|
84
|
+
const [error, setError] = useState('');
|
|
85
|
+
const openHelp = () => undefined;
|
|
86
|
+
const handleRecovery = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
87
|
+
if (!code) {
|
|
88
|
+
setIsValid(false);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
yield authRecoveryCode(code);
|
|
93
|
+
}
|
|
94
|
+
catch (e) {
|
|
95
|
+
setError(e.message || 'Something went wrong');
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
const handleCodeChanged = (event) => {
|
|
99
|
+
const inputCode = event.target.value;
|
|
100
|
+
setCode(inputCode);
|
|
101
|
+
if (validateMfaRecoveryCode(inputCode)) {
|
|
102
|
+
setIsValid(true);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
setIsValid(false);
|
|
106
|
+
setError('');
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
return (jsxs("div", { className: 'mfa-recovery-view', children: [error && jsx(ErrorContainer, { children: error }), !error && !isValid && (jsx(IconWithSpinner, { Icon: MfaRecoveryScreenIcon, isSpinning: !error && !isValid, iconSize: 96 })), jsx("div", { className: 'mfa-recovery-view__body', children: jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: t('dyn_mfa.recovery_view.body') }) }), jsxs("div", { className: 'mfa-recovery-view__actions', children: [jsx(Input, { id: 'mfa-recovery-input', "data-testid": 'mfa-recovery-input', label: t('dyn_mfa.recovery_view.input_label'), onChange: handleCodeChanged, value: code }), jsx(Button, { expanded: true, buttonVariant: 'brand-primary', disabled: !isValid, onClick: handleRecovery, dataTestId: 'mfa-recovery-submit', children: jsx(Typography, { children: t('dyn_mfa.recovery_view.button_label') }) })] }), jsxs("div", { className: 'mfa-recovery-view__get-help', children: [jsx(Typography, { variant: 'body_small', color: 'secondary', children: t('dyn_mfa.recovery_view.get_help.description') }), jsx("button", { onClick: openHelp, children: jsx(Typography, { variant: 'body_small', color: 'link', children: t('dyn_mfa.recovery_view.get_help.button_label') }) })] })] }));
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export { MfaRecoveryView };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MfaRecoveryView } from './MfaRecoveryView';
|
|
@@ -15,7 +15,6 @@ var CollectUserDataView = require('./CollectUserDataView/CollectUserDataView.cjs
|
|
|
15
15
|
var CollectUserDataViewNoWallet = require('./CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.cjs');
|
|
16
16
|
var CreatePasswordView = require('./CreatePasswordView/CreatePasswordView.cjs');
|
|
17
17
|
var EmailConfirmationWaitingView = require('./EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs');
|
|
18
|
-
var EmailUpdate = require('./EmailUpdate/EmailUpdate.cjs');
|
|
19
18
|
var EmailVerification = require('./EmailVerification/EmailVerification.cjs');
|
|
20
19
|
var EmailWalletOTPVerificationView = require('./EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs');
|
|
21
20
|
var EmbeddedRevealView = require('./EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs');
|
|
@@ -117,6 +116,7 @@ var WalletSignSpinnerView = require('./WalletSignSpinnerView/WalletSignSpinnerVi
|
|
|
117
116
|
var WalletUsedView = require('./WalletUsedView/WalletUsedView.cjs');
|
|
118
117
|
var MfaDisplayBackupCodesView = require('./MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.cjs');
|
|
119
118
|
var MfaVerificationView = require('./MfaVerificationView/MfaVerificationView.cjs');
|
|
119
|
+
var MfaRecoveryView = require('./MfaRecoveryView/MfaRecoveryView.cjs');
|
|
120
120
|
var PasskeyNewDomainDetectedView = require('./Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.cjs');
|
|
121
121
|
|
|
122
122
|
const viewToComponentMap = {
|
|
@@ -145,6 +145,7 @@ const viewToComponentMap = {
|
|
|
145
145
|
'merge-user-accounts-with-same-email': MergeUserAccountsWithSameEmailView.MergeUserAccountsWithSameEmailView,
|
|
146
146
|
'mfa-choose-device': MfaChooseDeviceView.MfaChooseDeviceView,
|
|
147
147
|
'mfa-display-backup-codes': MfaDisplayBackupCodesView.MfaDisplayBackupCodesView,
|
|
148
|
+
'mfa-recovery': MfaRecoveryView.MfaRecoveryView,
|
|
148
149
|
'mfa-secure-device': MfaSecureDeviceView.MfaSecureDeviceView,
|
|
149
150
|
'mfa-verification': MfaVerificationView.MfaVerificationView,
|
|
150
151
|
'multi-wallet-wallet-list': WalletList.WalletList,
|
|
@@ -167,7 +168,6 @@ const viewToComponentMap = {
|
|
|
167
168
|
'select-wallet-in-wallet-group': SelectWalletInWalletGroupView.SelectWalletInWalletGroupView,
|
|
168
169
|
'social-redirect-view': SocialRedirectView.SocialRedirectView,
|
|
169
170
|
'social-wrong-account': SocialWrongAccountView.SocialWrongAccountView,
|
|
170
|
-
'update-email': EmailUpdate.EmailUpdate,
|
|
171
171
|
'verify-email': EmailVerification.EmailVerification,
|
|
172
172
|
'verify-sms': SmsVerification.SmsVerification,
|
|
173
173
|
'wait-for-email-confirmation-view': EmailConfirmationWaitingView.EmailConfirmationWaitingView,
|
|
@@ -8,7 +8,7 @@ export declare const viewToComponentMap: {
|
|
|
8
8
|
'chainalysis-blocked-wallet': () => JSX.Element;
|
|
9
9
|
'collect-user-data': () => JSX.Element | null;
|
|
10
10
|
'collect-user-data-login-no-wallet': import("react").FC<{
|
|
11
|
-
userIdentification: keyof import("@dynamic-labs/sdk-api-core").UserFields | "chain" | "ens" | "wallet" | "isAuthenticatedWithAWallet" | "environmentId" | "lastVerifiedCredentialId" | "lists" | "newUser" | "sessionId" | "userId" | "verifiedCredentials" | "scope";
|
|
11
|
+
userIdentification: keyof import("@dynamic-labs/sdk-api-core").UserFields | "chain" | "ens" | "wallet" | "isAuthenticatedWithAWallet" | "environmentId" | "lastVerifiedCredentialId" | "lists" | "newUser" | "sessionId" | "userId" | "verifiedCredentials" | "scope" | "missingFields";
|
|
12
12
|
userIdentificationOverride?: string | undefined;
|
|
13
13
|
}>;
|
|
14
14
|
'create-password-view': import("react").FC<import("./CreatePasswordView/CreatePasswordView").CreatePasswordViewProps>;
|
|
@@ -28,6 +28,7 @@ export declare const viewToComponentMap: {
|
|
|
28
28
|
'merge-user-accounts-with-same-email': import("react").FC<import("./MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView").MergeUserAccountsWithSameEmailViewProps>;
|
|
29
29
|
'mfa-choose-device': () => JSX.Element;
|
|
30
30
|
'mfa-display-backup-codes': () => JSX.Element;
|
|
31
|
+
'mfa-recovery': import("react").FC;
|
|
31
32
|
'mfa-secure-device': ({ type }: import("./MfaSecureDeviceView").MfaSecureDeviceViewProps) => JSX.Element;
|
|
32
33
|
'mfa-verification': ({ type }: import("./MfaVerificationView").MfaVerificationViewProps) => JSX.Element;
|
|
33
34
|
'multi-wallet-wallet-list': ({ isWalletConnectList, }: import("./WalletList").WalletListProps) => JSX.Element;
|
|
@@ -55,7 +56,6 @@ export declare const viewToComponentMap: {
|
|
|
55
56
|
'select-wallet-in-wallet-group': import("react").FC;
|
|
56
57
|
'social-redirect-view': () => JSX.Element;
|
|
57
58
|
'social-wrong-account': () => JSX.Element | null;
|
|
58
|
-
'update-email': () => JSX.Element;
|
|
59
59
|
'verify-email': import("react").FC<import("./EmailVerification/EmailVerification").EmailVerificationProps>;
|
|
60
60
|
'verify-sms': import("react").FC;
|
|
61
61
|
'wait-for-email-confirmation-view': () => JSX.Element;
|
|
@@ -11,7 +11,6 @@ import { CollectUserDataView } from './CollectUserDataView/CollectUserDataView.j
|
|
|
11
11
|
import { CollectUserDataViewNoWallet } from './CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.js';
|
|
12
12
|
import { CreatePasswordView } from './CreatePasswordView/CreatePasswordView.js';
|
|
13
13
|
import { EmailConfirmationWaitingView } from './EmailConfirmationWaitingView/EmailConfirmationWaitingView.js';
|
|
14
|
-
import { EmailUpdate } from './EmailUpdate/EmailUpdate.js';
|
|
15
14
|
import { EmailVerification } from './EmailVerification/EmailVerification.js';
|
|
16
15
|
import { EmailWalletOTPVerificationView } from './EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js';
|
|
17
16
|
import { EmbeddedRevealView } from './EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js';
|
|
@@ -113,6 +112,7 @@ import { WalletSignSpinnerView } from './WalletSignSpinnerView/WalletSignSpinner
|
|
|
113
112
|
import { WalletUsedView } from './WalletUsedView/WalletUsedView.js';
|
|
114
113
|
import { MfaDisplayBackupCodesView } from './MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.js';
|
|
115
114
|
import { MfaVerificationView } from './MfaVerificationView/MfaVerificationView.js';
|
|
115
|
+
import { MfaRecoveryView } from './MfaRecoveryView/MfaRecoveryView.js';
|
|
116
116
|
import { PasskeyNewDomainDetectedView } from './Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.js';
|
|
117
117
|
|
|
118
118
|
const viewToComponentMap = {
|
|
@@ -141,6 +141,7 @@ const viewToComponentMap = {
|
|
|
141
141
|
'merge-user-accounts-with-same-email': MergeUserAccountsWithSameEmailView,
|
|
142
142
|
'mfa-choose-device': MfaChooseDeviceView,
|
|
143
143
|
'mfa-display-backup-codes': MfaDisplayBackupCodesView,
|
|
144
|
+
'mfa-recovery': MfaRecoveryView,
|
|
144
145
|
'mfa-secure-device': MfaSecureDeviceView,
|
|
145
146
|
'mfa-verification': MfaVerificationView,
|
|
146
147
|
'multi-wallet-wallet-list': WalletList,
|
|
@@ -163,7 +164,6 @@ const viewToComponentMap = {
|
|
|
163
164
|
'select-wallet-in-wallet-group': SelectWalletInWalletGroupView,
|
|
164
165
|
'social-redirect-view': SocialRedirectView,
|
|
165
166
|
'social-wrong-account': SocialWrongAccountView,
|
|
166
|
-
'update-email': EmailUpdate,
|
|
167
167
|
'verify-email': EmailVerification,
|
|
168
168
|
'verify-sms': SmsVerification,
|
|
169
169
|
'wait-for-email-confirmation-view': EmailConfirmationWaitingView,
|
|
@@ -83,11 +83,15 @@ require('@hcaptcha/react-hcaptcha');
|
|
|
83
83
|
require('../../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs');
|
|
84
84
|
|
|
85
85
|
const ProfileView = () => {
|
|
86
|
+
var _a, _b;
|
|
86
87
|
const { t } = reactI18next.useTranslation();
|
|
87
88
|
const { setBridgeWidgetView } = DynamicBridgeWidgetContext.useDynamicBridgeWidgetContext();
|
|
88
89
|
const { projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
89
90
|
// Allow to navigate to edit profile view when there are fields what can be edited
|
|
90
|
-
const editableUserFields = getUserProfileFields.getEditableUserProfileFields(
|
|
91
|
+
const editableUserFields = getUserProfileFields.getEditableUserProfileFields([
|
|
92
|
+
...((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.kyc) !== null && _a !== void 0 ? _a : []),
|
|
93
|
+
...((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.customFields) !== null && _b !== void 0 ? _b : []),
|
|
94
|
+
]);
|
|
91
95
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(UserProfile.UserProfile, { rootClassName: 'profile-view' }), jsxRuntime.jsx(DynamicWidgetFooter.DynamicWidgetFooter, { children: jsxRuntime.jsxs("div", { className: 'profile-view__footer', children: [editableUserFields.length > 0 && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'dynamic-widget-footer__button', buttonVariant: 'tertiary', buttonPadding: 'none', typographyProps: {
|
|
92
96
|
color: 'secondary',
|
|
93
97
|
variant: 'button_tertiary',
|
|
@@ -79,11 +79,15 @@ import '@hcaptcha/react-hcaptcha';
|
|
|
79
79
|
import '../../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js';
|
|
80
80
|
|
|
81
81
|
const ProfileView = () => {
|
|
82
|
+
var _a, _b;
|
|
82
83
|
const { t } = useTranslation();
|
|
83
84
|
const { setBridgeWidgetView } = useDynamicBridgeWidgetContext();
|
|
84
85
|
const { projectSettings } = useInternalDynamicContext();
|
|
85
86
|
// Allow to navigate to edit profile view when there are fields what can be edited
|
|
86
|
-
const editableUserFields = getEditableUserProfileFields(
|
|
87
|
+
const editableUserFields = getEditableUserProfileFields([
|
|
88
|
+
...((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.kyc) !== null && _a !== void 0 ? _a : []),
|
|
89
|
+
...((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.customFields) !== null && _b !== void 0 ? _b : []),
|
|
90
|
+
]);
|
|
87
91
|
return (jsxs(Fragment, { children: [jsx(UserProfile, { rootClassName: 'profile-view' }), jsx(DynamicWidgetFooter, { children: jsxs("div", { className: 'profile-view__footer', children: [editableUserFields.length > 0 && (jsx(TypographyButton, { buttonClassName: 'dynamic-widget-footer__button', buttonVariant: 'tertiary', buttonPadding: 'none', typographyProps: {
|
|
88
92
|
color: 'secondary',
|
|
89
93
|
variant: 'button_tertiary',
|
package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs
CHANGED
|
@@ -56,8 +56,7 @@ require('../../../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.
|
|
|
56
56
|
require('../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
57
57
|
require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
58
58
|
require('../../components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
59
|
-
var
|
|
60
|
-
require('react-focus-lock');
|
|
59
|
+
var PromptModal = require('../../components/PromptModal/PromptModal.cjs');
|
|
61
60
|
var WidgetPortal = require('../../components/WidgetPortal/WidgetPortal.cjs');
|
|
62
61
|
var useCloseMultiWalletPrompt = require('../../hooks/useCloseMultiWalletPrompt/useCloseMultiWalletPrompt.cjs');
|
|
63
62
|
var DefaultPromptModal = require('../DefaultPromptModal/DefaultPromptModal.cjs');
|
|
@@ -76,6 +75,7 @@ require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
|
76
75
|
require('../../../../components/IsBrowser/IsBrowser.cjs');
|
|
77
76
|
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
78
77
|
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
78
|
+
require('react-focus-lock');
|
|
79
79
|
require('qrcode');
|
|
80
80
|
require('../../../../views/WalletList/WalletList.cjs');
|
|
81
81
|
require('../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
@@ -99,7 +99,7 @@ const PendingConnectionContent = () => {
|
|
|
99
99
|
return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptLayout, { dataTestId: 'pending-connection-modal', icon: jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon // eslint-disable-line
|
|
100
100
|
, { jwt: authToken, wallet: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet }), title: title, children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: description }) }));
|
|
101
101
|
};
|
|
102
|
-
const PendingConnectionModal = () => (jsxRuntime.jsx(
|
|
102
|
+
const PendingConnectionModal = () => (jsxRuntime.jsx(PromptModal.PromptModal, { onClose: useCloseMultiWalletPrompt.useCloseMultiWalletPrompt, children: jsxRuntime.jsx(PendingConnectionContent, {}) }));
|
|
103
103
|
const PendingConnectionWidgetPortal = () => (jsxRuntime.jsx(WidgetPortal.WidgetPortal, { onClose: useCloseMultiWalletPrompt.useCloseMultiWalletPrompt(), children: jsxRuntime.jsx(PendingConnectionContent, {}) }));
|
|
104
104
|
|
|
105
105
|
exports.PendingConnectionModal = PendingConnectionModal;
|