@dynamic-labs/sdk-react-core 4.79.1 → 4.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +14 -14
- package/src/index.cjs +2 -2
- package/src/index.js +1 -1
- package/src/lib/Main.cjs +2 -2
- package/src/lib/Main.js +2 -2
- package/src/lib/client/extension/deprecated/mfa/verifyTotpMfaDevice/verifyTotpMfaDevice.d.ts +1 -1
- package/src/lib/components/LogoutButton/LogoutButton.cjs +2 -2
- package/src/lib/components/LogoutButton/LogoutButton.js +2 -2
- package/src/lib/context/DynamicContext/DynamicContext.cjs +6 -4
- package/src/lib/context/DynamicContext/DynamicContext.js +6 -4
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +9 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +25 -12
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.d.ts +5 -3
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +24 -11
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.cjs +3 -3
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.d.ts +3 -2
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.js +3 -3
- package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +2 -0
- package/src/lib/context/DynamicContext/types/IInternalDynamicContext.d.ts +8 -1
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/events/auth.d.ts +2 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/authViewLayoutChecks.cjs +2 -0
- package/src/lib/utils/constants/authViewLayoutChecks.js +2 -0
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.cjs +2 -2
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.js +2 -2
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +1 -1
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +1 -1
- package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.cjs +7 -2
- package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.d.ts +2 -1
- package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.js +7 -2
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +3 -3
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +3 -3
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.cjs +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.d.ts +2 -1
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.js +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.cjs +3 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.d.ts +2 -2
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.js +3 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +3 -3
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.d.ts +3 -3
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +3 -3
- package/src/lib/utils/hooks/useWalletBackup/useWalletBackup.cjs +1 -1
- package/src/lib/utils/hooks/useWalletBackup/useWalletBackup.js +1 -1
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.cjs +1 -1
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.js +1 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +2 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +3 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +2 -2
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +5 -5
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +5 -5
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -2
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -2
- package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.cjs +2 -2
- package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.js +2 -2
- package/src/lib/views/DeviceRegistrationView/DeviceRegistrationView.cjs +2 -2
- package/src/lib/views/DeviceRegistrationView/DeviceRegistrationView.js +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -2
- package/src/lib/views/EmbeddedDeleteView/EmbeddedDeleteView.cjs +2 -2
- package/src/lib/views/EmbeddedDeleteView/EmbeddedDeleteView.js +2 -2
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +7 -7
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +7 -7
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.cjs +7 -7
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.js +7 -7
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +5 -5
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +5 -5
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +2 -2
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +2 -2
- package/src/lib/views/SmsVerification/SmsVerification.cjs +2 -2
- package/src/lib/views/SmsVerification/SmsVerification.js +2 -2
- package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.cjs +2 -2
- package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.js +2 -2
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +2 -2
- package/src/lib/views/WalletLockedView/WalletLockedView.js +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.js +2 -2
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupCloudProviderView.cjs +19 -4
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupCloudProviderView.js +19 -4
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupGrantAccessView.cjs +50 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupGrantAccessView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupGrantAccessView.js +46 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupProgressView.cjs +23 -3
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupProgressView.js +23 -3
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/index.d.ts +1 -0
|
@@ -119,14 +119,14 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
119
119
|
|
|
120
120
|
const CollectUserDataViewNoWallet = ({ userIdentification, userIdentificationOverride }) => {
|
|
121
121
|
var _a;
|
|
122
|
-
const { appName,
|
|
122
|
+
const { appName, handleLogOutWithReason, projectSettings, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
123
123
|
const { t } = reactI18next.useTranslation();
|
|
124
124
|
if (!userWithMissingInfo) {
|
|
125
125
|
return null;
|
|
126
126
|
}
|
|
127
127
|
return (jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsxRuntime.jsx(UserAvatar.UserAvatar, { user: userWithMissingInfo }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-no-wallet__user-identification', children: (_a = userIdentificationOverride !== null && userIdentificationOverride !== void 0 ? userIdentificationOverride : userWithMissingInfo[userIdentification]) !== null && _a !== void 0 ? _a : getUserIdentifier.getUserIdentifier(userWithMissingInfo) })] }), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__form', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { userProfile: userWithMissingInfo, children: jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-no-wallet__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
|
|
128
128
|
t('dyn_collect_user_data.greeting', { appName }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
|
|
129
|
-
t('dyn_collect_user_data.description') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick:
|
|
129
|
+
t('dyn_collect_user_data.description') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: () => handleLogOutWithReason('user-data-collection-cancelled'), copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
exports.CollectUserDataViewNoWallet = CollectUserDataViewNoWallet;
|
|
@@ -115,14 +115,14 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
115
115
|
|
|
116
116
|
const CollectUserDataViewNoWallet = ({ userIdentification, userIdentificationOverride }) => {
|
|
117
117
|
var _a;
|
|
118
|
-
const { appName,
|
|
118
|
+
const { appName, handleLogOutWithReason, projectSettings, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext();
|
|
119
119
|
const { t } = useTranslation();
|
|
120
120
|
if (!userWithMissingInfo) {
|
|
121
121
|
return null;
|
|
122
122
|
}
|
|
123
123
|
return (jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsx(UserAvatar, { user: userWithMissingInfo }) }), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-no-wallet__user-identification', children: (_a = userIdentificationOverride !== null && userIdentificationOverride !== void 0 ? userIdentificationOverride : userWithMissingInfo[userIdentification]) !== null && _a !== void 0 ? _a : getUserIdentifier(userWithMissingInfo) })] }), jsxs("div", { className: 'collect-user-data-login-no-wallet__form', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { userProfile: userWithMissingInfo, children: jsxs("div", { className: 'collect-user-data-login-no-wallet__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-no-wallet__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
|
|
124
124
|
t('dyn_collect_user_data.greeting', { appName }) }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
|
|
125
|
-
t('dyn_collect_user_data.description') })] }) }), jsx(TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick:
|
|
125
|
+
t('dyn_collect_user_data.description') })] }) }), jsx(TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: () => handleLogOutWithReason('user-data-collection-cancelled'), copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
export { CollectUserDataViewNoWallet };
|
|
@@ -116,7 +116,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
116
116
|
|
|
117
117
|
const DeviceRegistrationView = () => {
|
|
118
118
|
const { t } = reactI18next.useTranslation();
|
|
119
|
-
const {
|
|
119
|
+
const { handleLogOutWithReason, setShowAuthFlow, clearStatesOnBackClick } = useInternalDynamicContext.useInternalDynamicContext();
|
|
120
120
|
const user = useUser.useUser();
|
|
121
121
|
const dynamicClient = client.useDynamicClient();
|
|
122
122
|
utils.assertDefined(user === null || user === void 0 ? void 0 : user.email, 'User email is not defined');
|
|
@@ -134,7 +134,7 @@ const DeviceRegistrationView = () => {
|
|
|
134
134
|
setShowAuthFlow(false);
|
|
135
135
|
},
|
|
136
136
|
}, dynamicClient), [dynamicClient, setShowAuthFlow, clearStatesOnBackClick]);
|
|
137
|
-
return (jsxRuntime.jsxs("div", { className: 'device-registration-view', "data-testid": 'device-registration-view', children: [jsxRuntime.jsx("div", { className: 'device-registration-view__icon', children: jsxRuntime.jsx(securityAlert.ReactComponent, { width: 55, height: 64 }) }), jsxRuntime.jsx(Typography.Typography, { weight: 'regular', variant: 'body_normal', color: 'secondary', copykey: 'dyn_device_registration.description', children: t('dyn_device_registration.description', { email: user.email }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'device-registration-view__logout-button', onClick:
|
|
137
|
+
return (jsxRuntime.jsxs("div", { className: 'device-registration-view', "data-testid": 'device-registration-view', children: [jsxRuntime.jsx("div", { className: 'device-registration-view__icon', children: jsxRuntime.jsx(securityAlert.ReactComponent, { width: 55, height: 64 }) }), jsxRuntime.jsx(Typography.Typography, { weight: 'regular', variant: 'body_normal', color: 'secondary', copykey: 'dyn_device_registration.description', children: t('dyn_device_registration.description', { email: user.email }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'device-registration-view__logout-button', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_device_registration.logout', children: t('dyn_device_registration.logout') })] }));
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
exports.DeviceRegistrationView = DeviceRegistrationView;
|
|
@@ -112,7 +112,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
112
112
|
|
|
113
113
|
const DeviceRegistrationView = () => {
|
|
114
114
|
const { t } = useTranslation();
|
|
115
|
-
const {
|
|
115
|
+
const { handleLogOutWithReason, setShowAuthFlow, clearStatesOnBackClick } = useInternalDynamicContext();
|
|
116
116
|
const user = useUser();
|
|
117
117
|
const dynamicClient = useDynamicClient();
|
|
118
118
|
assertDefined(user === null || user === void 0 ? void 0 : user.email, 'User email is not defined');
|
|
@@ -130,7 +130,7 @@ const DeviceRegistrationView = () => {
|
|
|
130
130
|
setShowAuthFlow(false);
|
|
131
131
|
},
|
|
132
132
|
}, dynamicClient), [dynamicClient, setShowAuthFlow, clearStatesOnBackClick]);
|
|
133
|
-
return (jsxs("div", { className: 'device-registration-view', "data-testid": 'device-registration-view', children: [jsx("div", { className: 'device-registration-view__icon', children: jsx(SvgSecurityAlert, { width: 55, height: 64 }) }), jsx(Typography, { weight: 'regular', variant: 'body_normal', color: 'secondary', copykey: 'dyn_device_registration.description', children: t('dyn_device_registration.description', { email: user.email }) }), jsx(TextButton, { className: 'device-registration-view__logout-button', onClick:
|
|
133
|
+
return (jsxs("div", { className: 'device-registration-view', "data-testid": 'device-registration-view', children: [jsx("div", { className: 'device-registration-view__icon', children: jsx(SvgSecurityAlert, { width: 55, height: 64 }) }), jsx(Typography, { weight: 'regular', variant: 'body_normal', color: 'secondary', copykey: 'dyn_device_registration.description', children: t('dyn_device_registration.description', { email: user.email }) }), jsx(TextButton, { className: 'device-registration-view__logout-button', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_device_registration.logout', children: t('dyn_device_registration.logout') })] }));
|
|
134
134
|
};
|
|
135
135
|
|
|
136
136
|
export { DeviceRegistrationView };
|
|
@@ -141,7 +141,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
141
141
|
const SECONDS_TO_RETRY = 15;
|
|
142
142
|
const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _showRetryButton = true, showTransferMessage: _showTransferMessage = false, }) => {
|
|
143
143
|
var _a, _b, _c, _d;
|
|
144
|
-
const { environmentId,
|
|
144
|
+
const { environmentId, handleLogOutWithReason, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, primaryWallet, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
145
145
|
const { pushView, clearStackAndPushInitialView } = ViewContext.useViewContext();
|
|
146
146
|
const { error, setError, setErrorMessage } = ErrorContext.useErrorContext();
|
|
147
147
|
const { loading, setLoading } = LoadingContext.useLoadingContext();
|
|
@@ -372,7 +372,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
372
372
|
}, []);
|
|
373
373
|
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', {
|
|
374
374
|
'email-verification__container--error': Boolean(error),
|
|
375
|
-
}), 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).fill(''), isLoading: loading, handleComplete: handleEmailVerification, 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 })), (user || userWithMissingInfo) && !isEmailRecoveryFlow && (jsxRuntime.jsx(TextButton.TextButton, { className: 'email-verification__log-out', onClick:
|
|
375
|
+
}), 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).fill(''), isLoading: loading, handleComplete: handleEmailVerification, 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 })), (user || userWithMissingInfo) && !isEmailRecoveryFlow && (jsxRuntime.jsx(TextButton.TextButton, { className: 'email-verification__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
|
|
376
376
|
};
|
|
377
377
|
|
|
378
378
|
exports.EmailVerification = EmailVerification;
|
|
@@ -137,7 +137,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
137
137
|
const SECONDS_TO_RETRY = 15;
|
|
138
138
|
const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _showRetryButton = true, showTransferMessage: _showTransferMessage = false, }) => {
|
|
139
139
|
var _a, _b, _c, _d;
|
|
140
|
-
const { environmentId,
|
|
140
|
+
const { environmentId, handleLogOutWithReason, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, primaryWallet, } = useInternalDynamicContext();
|
|
141
141
|
const { pushView, clearStackAndPushInitialView } = useViewContext();
|
|
142
142
|
const { error, setError, setErrorMessage } = useErrorContext();
|
|
143
143
|
const { loading, setLoading } = useLoadingContext();
|
|
@@ -368,7 +368,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
368
368
|
}, []);
|
|
369
369
|
return (jsxs(Fragment, { children: [error && (jsx(ErrorContainer, { withIcon: false, className: 'email-verification__error-message', children: error })), jsxs("div", { className: classNames('email-verification__container', {
|
|
370
370
|
'email-verification__container--error': Boolean(error),
|
|
371
|
-
}), 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).fill(''), isLoading: loading, handleComplete: handleEmailVerification, 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 })), (user || userWithMissingInfo) && !isEmailRecoveryFlow && (jsx(TextButton, { className: 'email-verification__log-out', onClick:
|
|
371
|
+
}), 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).fill(''), isLoading: loading, handleComplete: handleEmailVerification, 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 })), (user || userWithMissingInfo) && !isEmailRecoveryFlow && (jsx(TextButton, { className: 'email-verification__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
|
|
372
372
|
};
|
|
373
373
|
|
|
374
374
|
export { EmailVerification };
|
|
@@ -120,7 +120,7 @@ require('../../components/Popper/Popper/Popper.cjs');
|
|
|
120
120
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
121
121
|
|
|
122
122
|
const EmbeddedDeleteView = () => {
|
|
123
|
-
const { primaryWallet, setShowAuthFlow, environmentId,
|
|
123
|
+
const { primaryWallet, setShowAuthFlow, environmentId, handleLogOutWithReason, user, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
124
124
|
const [isAcknowledgementChecked, setIsAcknowledgementChecked] = React.useState(false);
|
|
125
125
|
const [error, setError] = React.useState(undefined);
|
|
126
126
|
const { t } = reactI18next.useTranslation();
|
|
@@ -162,7 +162,7 @@ const EmbeddedDeleteView = () => {
|
|
|
162
162
|
deleteEmbeddedWalletsRequest: signedDeleteWalletsRequest,
|
|
163
163
|
environmentId,
|
|
164
164
|
});
|
|
165
|
-
|
|
165
|
+
handleLogOutWithReason('user-deleted');
|
|
166
166
|
}
|
|
167
167
|
catch (error) {
|
|
168
168
|
setError(error);
|
|
@@ -116,7 +116,7 @@ import '../../components/Popper/Popper/Popper.js';
|
|
|
116
116
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
117
117
|
|
|
118
118
|
const EmbeddedDeleteView = () => {
|
|
119
|
-
const { primaryWallet, setShowAuthFlow, environmentId,
|
|
119
|
+
const { primaryWallet, setShowAuthFlow, environmentId, handleLogOutWithReason, user, } = useInternalDynamicContext();
|
|
120
120
|
const [isAcknowledgementChecked, setIsAcknowledgementChecked] = useState(false);
|
|
121
121
|
const [error, setError] = useState(undefined);
|
|
122
122
|
const { t } = useTranslation();
|
|
@@ -158,7 +158,7 @@ const EmbeddedDeleteView = () => {
|
|
|
158
158
|
deleteEmbeddedWalletsRequest: signedDeleteWalletsRequest,
|
|
159
159
|
environmentId,
|
|
160
160
|
});
|
|
161
|
-
|
|
161
|
+
handleLogOutWithReason('user-deleted');
|
|
162
162
|
}
|
|
163
163
|
catch (error) {
|
|
164
164
|
setError(error);
|
|
@@ -17,16 +17,18 @@ require('@dynamic-labs/utils');
|
|
|
17
17
|
require('../../components/Alert/Alert.cjs');
|
|
18
18
|
require('../../events/dynamicEvents.cjs');
|
|
19
19
|
require('../../../../_virtual/_tslib.cjs');
|
|
20
|
-
var useDynamicContext = require('../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
|
|
21
20
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
21
|
+
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
22
22
|
require('@dynamic-labs/wallet-connector-core');
|
|
23
|
-
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
24
|
-
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
25
23
|
var logger = require('../../shared/logger.cjs');
|
|
26
24
|
require('@dynamic-labs/wallet-book');
|
|
27
25
|
require('../../utils/constants/colors.cjs');
|
|
28
26
|
require('../../utils/constants/values.cjs');
|
|
29
27
|
require('../../shared/consts/index.cjs');
|
|
28
|
+
require('../../store/state/authMode/authMode.cjs');
|
|
29
|
+
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
30
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
31
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
30
32
|
require('@dynamic-labs/multi-wallet');
|
|
31
33
|
require('react-international-phone');
|
|
32
34
|
require('../../store/state/nonce/nonce.cjs');
|
|
@@ -42,8 +44,6 @@ require('../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.c
|
|
|
42
44
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
43
45
|
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
44
46
|
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
45
|
-
require('../../store/state/authMode/authMode.cjs');
|
|
46
|
-
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
47
47
|
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
48
48
|
require('react-dom');
|
|
49
49
|
require('../../utils/functions/compareChains/compareChains.cjs');
|
|
@@ -120,7 +120,7 @@ require('../../components/Popper/Popper/Popper.cjs');
|
|
|
120
120
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
121
121
|
|
|
122
122
|
const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, requestedScopes, }) => {
|
|
123
|
-
const {
|
|
123
|
+
const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
124
124
|
const { t } = reactI18next.useTranslation();
|
|
125
125
|
const { pushView } = ViewContext.useViewContext();
|
|
126
126
|
const registerPasskey = useRegisterPasskey.useRegisterPasskey();
|
|
@@ -189,7 +189,7 @@ const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, re
|
|
|
189
189
|
? t('dyn_mfa.choose_device_view.title')
|
|
190
190
|
: t('dyn_mfa.choose_device_view.choose_another_method') }) }) }), jsxRuntime.jsxs("div", { className: 'mfa-choose-device-view__body', "data-testid": 'mfa-choose-device-view', children: [jsxRuntime.jsx(secureAccount.ReactComponent, {}), jsxRuntime.jsx(Typography.Typography, { className: 'mfa-choose-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', children: isInitialSetup
|
|
191
191
|
? t('dyn_mfa.choose_device_view.select_options')
|
|
192
|
-
: t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxRuntime.jsxs(Button.Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxRuntime.jsxs("div", { className: 'mfa-choose-device-view__button__header', "data-testid": `mfa-device-header-${option.type}`, children: [jsxRuntime.jsx(Typography.Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsxRuntime.jsx(Typography.Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-choose-device-view__logout', onClick:
|
|
192
|
+
: t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxRuntime.jsxs(Button.Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxRuntime.jsxs("div", { className: 'mfa-choose-device-view__button__header', "data-testid": `mfa-device-header-${option.type}`, children: [jsxRuntime.jsx(Typography.Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsxRuntime.jsx(Typography.Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-choose-device-view__logout', onClick: () => handleLogOutWithReason('mfa-choose-device-cancelled'), copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.choose_device_view.logout') })] })] }));
|
|
193
193
|
};
|
|
194
194
|
|
|
195
195
|
exports.MfaChooseDeviceView = MfaChooseDeviceView;
|
|
@@ -13,16 +13,18 @@ import '@dynamic-labs/utils';
|
|
|
13
13
|
import '../../components/Alert/Alert.js';
|
|
14
14
|
import '../../events/dynamicEvents.js';
|
|
15
15
|
import '../../../../_virtual/_tslib.js';
|
|
16
|
-
import { useDynamicContext } from '../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
|
|
17
16
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
17
|
+
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
18
18
|
import '@dynamic-labs/wallet-connector-core';
|
|
19
|
-
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
20
|
-
import '../../context/ErrorContext/ErrorContext.js';
|
|
21
19
|
import { logger } from '../../shared/logger.js';
|
|
22
20
|
import '@dynamic-labs/wallet-book';
|
|
23
21
|
import '../../utils/constants/colors.js';
|
|
24
22
|
import '../../utils/constants/values.js';
|
|
25
23
|
import '../../shared/consts/index.js';
|
|
24
|
+
import '../../store/state/authMode/authMode.js';
|
|
25
|
+
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
26
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
27
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
26
28
|
import '@dynamic-labs/multi-wallet';
|
|
27
29
|
import 'react-international-phone';
|
|
28
30
|
import '../../store/state/nonce/nonce.js';
|
|
@@ -38,8 +40,6 @@ import '../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js
|
|
|
38
40
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
39
41
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
40
42
|
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
41
|
-
import '../../store/state/authMode/authMode.js';
|
|
42
|
-
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
43
43
|
import '../../context/VerificationContext/VerificationContext.js';
|
|
44
44
|
import 'react-dom';
|
|
45
45
|
import '../../utils/functions/compareChains/compareChains.js';
|
|
@@ -116,7 +116,7 @@ import '../../components/Popper/Popper/Popper.js';
|
|
|
116
116
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
117
117
|
|
|
118
118
|
const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, requestedScopes, }) => {
|
|
119
|
-
const {
|
|
119
|
+
const { handleLogOutWithReason } = useInternalDynamicContext();
|
|
120
120
|
const { t } = useTranslation();
|
|
121
121
|
const { pushView } = useViewContext();
|
|
122
122
|
const registerPasskey = useRegisterPasskey();
|
|
@@ -185,7 +185,7 @@ const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, re
|
|
|
185
185
|
? t('dyn_mfa.choose_device_view.title')
|
|
186
186
|
: t('dyn_mfa.choose_device_view.choose_another_method') }) }) }), jsxs("div", { className: 'mfa-choose-device-view__body', "data-testid": 'mfa-choose-device-view', children: [jsx(SvgSecureAccount, {}), jsx(Typography, { className: 'mfa-choose-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', children: isInitialSetup
|
|
187
187
|
? t('dyn_mfa.choose_device_view.select_options')
|
|
188
|
-
: t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxs(Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxs("div", { className: 'mfa-choose-device-view__button__header', "data-testid": `mfa-device-header-${option.type}`, children: [jsx(Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsx(SvgChevronLeft, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsx(Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsx(TextButton, { className: 'mfa-choose-device-view__logout', onClick:
|
|
188
|
+
: t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxs(Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxs("div", { className: 'mfa-choose-device-view__button__header', "data-testid": `mfa-device-header-${option.type}`, children: [jsx(Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsx(SvgChevronLeft, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsx(Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsx(TextButton, { className: 'mfa-choose-device-view__logout', onClick: () => handleLogOutWithReason('mfa-choose-device-cancelled'), copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.choose_device_view.logout') })] })] }));
|
|
189
189
|
};
|
|
190
190
|
|
|
191
191
|
export { MfaChooseDeviceView };
|
|
@@ -15,17 +15,19 @@ require('@dynamic-labs/utils');
|
|
|
15
15
|
var spinner = require('../../components/Spinner/spinner.cjs');
|
|
16
16
|
require('../../components/Alert/Alert.cjs');
|
|
17
17
|
require('../../events/dynamicEvents.cjs');
|
|
18
|
-
var useDynamicContext = require('../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
|
|
19
18
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
19
|
+
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
20
20
|
require('@dynamic-labs/wallet-connector-core');
|
|
21
|
-
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
22
|
-
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
23
21
|
require('../../shared/logger.cjs');
|
|
24
22
|
require('@dynamic-labs/wallet-book');
|
|
25
23
|
require('../../utils/constants/colors.cjs');
|
|
26
24
|
require('../../utils/constants/values.cjs');
|
|
27
25
|
require('@dynamic-labs/sdk-api-core');
|
|
28
26
|
require('../../shared/consts/index.cjs');
|
|
27
|
+
require('../../store/state/authMode/authMode.cjs');
|
|
28
|
+
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
29
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
30
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
29
31
|
require('@dynamic-labs/multi-wallet');
|
|
30
32
|
require('react-international-phone');
|
|
31
33
|
require('../../store/state/nonce/nonce.cjs');
|
|
@@ -41,8 +43,6 @@ require('../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.c
|
|
|
41
43
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
42
44
|
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
43
45
|
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
44
|
-
require('../../store/state/authMode/authMode.cjs');
|
|
45
|
-
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
46
46
|
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
47
47
|
require('react-dom');
|
|
48
48
|
require('../../utils/functions/compareChains/compareChains.cjs');
|
|
@@ -119,7 +119,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
119
119
|
|
|
120
120
|
const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
|
|
121
121
|
const { t } = reactI18next.useTranslation();
|
|
122
|
-
const {
|
|
122
|
+
const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
123
123
|
const { pushView } = ViewContext.useViewContext();
|
|
124
124
|
const { addDevice } = useMfa.useMfa();
|
|
125
125
|
const { data, isLoading } = usePromise.usePromise(() => addDevice(type));
|
|
@@ -137,7 +137,7 @@ const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
|
|
|
137
137
|
uri,
|
|
138
138
|
});
|
|
139
139
|
};
|
|
140
|
-
return (jsxRuntime.jsxs("div", { className: 'mfa-secure-device-view__body', "data-testid": 'mfa-secure-device-view', children: [jsxRuntime.jsx(Typography.Typography, { className: 'mfa-secure-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.body', children: t('dyn_mfa.secure_device_view.body') }), isLoading && (jsxRuntime.jsx(spinner.Spinner, { className: 'mfa-secure-device-view__loading-spinner' })), data && (jsxRuntime.jsxs("div", { className: 'mfa-secure-device-view__qrcode', children: [jsxRuntime.jsx(QRCode.QRCode, { Icon: jsxRuntime.jsx(passwordHero.ReactComponent, {}), value: data.uri, logoSize: 50 }), jsxRuntime.jsx("div", { className: 'button-container', children: jsxRuntime.jsx("button", { onClick: () => onHelpClick({ secret: data.secret, uri: data.uri }), children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.helper.button', children: t('dyn_mfa.secure_device_view.helper.button') }) }) })] })), jsxRuntime.jsx(TypographyButton.TypographyButton, { className: 'mfa-secure-device-view__button', expanded: true, onClick: onContinue, copykey: 'dyn_mfa.secure_device_view.continue', children: t('dyn_mfa.secure_device_view.continue') }), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-secure-device-view__logout-button', onClick:
|
|
140
|
+
return (jsxRuntime.jsxs("div", { className: 'mfa-secure-device-view__body', "data-testid": 'mfa-secure-device-view', children: [jsxRuntime.jsx(Typography.Typography, { className: 'mfa-secure-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.body', children: t('dyn_mfa.secure_device_view.body') }), isLoading && (jsxRuntime.jsx(spinner.Spinner, { className: 'mfa-secure-device-view__loading-spinner' })), data && (jsxRuntime.jsxs("div", { className: 'mfa-secure-device-view__qrcode', children: [jsxRuntime.jsx(QRCode.QRCode, { Icon: jsxRuntime.jsx(passwordHero.ReactComponent, {}), value: data.uri, logoSize: 50 }), jsxRuntime.jsx("div", { className: 'button-container', children: jsxRuntime.jsx("button", { onClick: () => onHelpClick({ secret: data.secret, uri: data.uri }), children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.helper.button', children: t('dyn_mfa.secure_device_view.helper.button') }) }) })] })), jsxRuntime.jsx(TypographyButton.TypographyButton, { className: 'mfa-secure-device-view__button', expanded: true, onClick: onContinue, copykey: 'dyn_mfa.secure_device_view.continue', children: t('dyn_mfa.secure_device_view.continue') }), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-secure-device-view__logout-button', onClick: () => handleLogOutWithReason('mfa-secure-device-cancelled'), copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.secure_device_view.logout') })] }));
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
exports.MfaSecureDeviceView = MfaSecureDeviceView;
|
|
@@ -11,17 +11,19 @@ import '@dynamic-labs/utils';
|
|
|
11
11
|
import { Spinner } from '../../components/Spinner/spinner.js';
|
|
12
12
|
import '../../components/Alert/Alert.js';
|
|
13
13
|
import '../../events/dynamicEvents.js';
|
|
14
|
-
import { useDynamicContext } from '../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
|
|
15
14
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
15
|
+
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
16
16
|
import '@dynamic-labs/wallet-connector-core';
|
|
17
|
-
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
18
|
-
import '../../context/ErrorContext/ErrorContext.js';
|
|
19
17
|
import '../../shared/logger.js';
|
|
20
18
|
import '@dynamic-labs/wallet-book';
|
|
21
19
|
import '../../utils/constants/colors.js';
|
|
22
20
|
import '../../utils/constants/values.js';
|
|
23
21
|
import '@dynamic-labs/sdk-api-core';
|
|
24
22
|
import '../../shared/consts/index.js';
|
|
23
|
+
import '../../store/state/authMode/authMode.js';
|
|
24
|
+
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
25
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
26
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
25
27
|
import '@dynamic-labs/multi-wallet';
|
|
26
28
|
import 'react-international-phone';
|
|
27
29
|
import '../../store/state/nonce/nonce.js';
|
|
@@ -37,8 +39,6 @@ import '../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js
|
|
|
37
39
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
38
40
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
39
41
|
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
40
|
-
import '../../store/state/authMode/authMode.js';
|
|
41
|
-
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
42
42
|
import '../../context/VerificationContext/VerificationContext.js';
|
|
43
43
|
import 'react-dom';
|
|
44
44
|
import '../../utils/functions/compareChains/compareChains.js';
|
|
@@ -115,7 +115,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
115
115
|
|
|
116
116
|
const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
|
|
117
117
|
const { t } = useTranslation();
|
|
118
|
-
const {
|
|
118
|
+
const { handleLogOutWithReason } = useInternalDynamicContext();
|
|
119
119
|
const { pushView } = useViewContext();
|
|
120
120
|
const { addDevice } = useMfa();
|
|
121
121
|
const { data, isLoading } = usePromise(() => addDevice(type));
|
|
@@ -133,7 +133,7 @@ const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
|
|
|
133
133
|
uri,
|
|
134
134
|
});
|
|
135
135
|
};
|
|
136
|
-
return (jsxs("div", { className: 'mfa-secure-device-view__body', "data-testid": 'mfa-secure-device-view', children: [jsx(Typography, { className: 'mfa-secure-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.body', children: t('dyn_mfa.secure_device_view.body') }), isLoading && (jsx(Spinner, { className: 'mfa-secure-device-view__loading-spinner' })), data && (jsxs("div", { className: 'mfa-secure-device-view__qrcode', children: [jsx(QRCode, { Icon: jsx(SvgPasswordHero, {}), value: data.uri, logoSize: 50 }), jsx("div", { className: 'button-container', children: jsx("button", { onClick: () => onHelpClick({ secret: data.secret, uri: data.uri }), children: jsx(Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.helper.button', children: t('dyn_mfa.secure_device_view.helper.button') }) }) })] })), jsx(TypographyButton, { className: 'mfa-secure-device-view__button', expanded: true, onClick: onContinue, copykey: 'dyn_mfa.secure_device_view.continue', children: t('dyn_mfa.secure_device_view.continue') }), jsx(TextButton, { className: 'mfa-secure-device-view__logout-button', onClick:
|
|
136
|
+
return (jsxs("div", { className: 'mfa-secure-device-view__body', "data-testid": 'mfa-secure-device-view', children: [jsx(Typography, { className: 'mfa-secure-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.body', children: t('dyn_mfa.secure_device_view.body') }), isLoading && (jsx(Spinner, { className: 'mfa-secure-device-view__loading-spinner' })), data && (jsxs("div", { className: 'mfa-secure-device-view__qrcode', children: [jsx(QRCode, { Icon: jsx(SvgPasswordHero, {}), value: data.uri, logoSize: 50 }), jsx("div", { className: 'button-container', children: jsx("button", { onClick: () => onHelpClick({ secret: data.secret, uri: data.uri }), children: jsx(Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.helper.button', children: t('dyn_mfa.secure_device_view.helper.button') }) }) })] })), jsx(TypographyButton, { className: 'mfa-secure-device-view__button', expanded: true, onClick: onContinue, copykey: 'dyn_mfa.secure_device_view.continue', children: t('dyn_mfa.secure_device_view.continue') }), jsx(TextButton, { className: 'mfa-secure-device-view__logout-button', onClick: () => handleLogOutWithReason('mfa-secure-device-cancelled'), copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.secure_device_view.logout') })] }));
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
export { MfaSecureDeviceView };
|
|
@@ -34,15 +34,15 @@ require('../../events/dynamicEvents.cjs');
|
|
|
34
34
|
var getUserProfile = require('../../client/extension/user/getUserProfile/getUserProfile.cjs');
|
|
35
35
|
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
36
36
|
require('../../components/Alert/Alert.cjs');
|
|
37
|
-
var useDynamicContext = require('../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
|
|
38
37
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
38
|
+
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
39
|
+
require('../../store/state/authMode/authMode.cjs');
|
|
40
|
+
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
39
41
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
40
42
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
41
43
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
42
44
|
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
43
45
|
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
44
|
-
require('../../store/state/authMode/authMode.cjs');
|
|
45
|
-
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
46
46
|
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
47
47
|
require('react-dom');
|
|
48
48
|
require('../../utils/functions/compareChains/compareChains.cjs');
|
|
@@ -118,7 +118,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
118
118
|
|
|
119
119
|
const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = false, createMfaToken = false, deviceId, requestedScopes, }) => {
|
|
120
120
|
const { t } = reactI18next.useTranslation();
|
|
121
|
-
const {
|
|
121
|
+
const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
122
122
|
const { clearStackAndPush, pushView, goBack, canGoBack } = ViewContext.useViewContext();
|
|
123
123
|
const { authenticateDevice } = useMfa.useMfa();
|
|
124
124
|
const [code, setCode] = React.useState('');
|
|
@@ -170,7 +170,7 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
|
|
|
170
170
|
createMfaToken,
|
|
171
171
|
isInitialSetup,
|
|
172
172
|
requestedScopes,
|
|
173
|
-
}), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsxRuntime.jsx(TextButton.TextButton, { onClick:
|
|
173
|
+
}), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsxRuntime.jsx(TextButton.TextButton, { onClick: () => handleLogOutWithReason('mfa-verification-cancelled'), copykey: 'dyn_mfa.otp_verification_view.logout', children: t('dyn_mfa.otp_verification_view.logout') })] }))] }));
|
|
174
174
|
};
|
|
175
175
|
|
|
176
176
|
exports.MfaVerificationView = MfaVerificationView;
|
|
@@ -30,15 +30,15 @@ import '../../events/dynamicEvents.js';
|
|
|
30
30
|
import { getUserProfile } from '../../client/extension/user/getUserProfile/getUserProfile.js';
|
|
31
31
|
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
32
32
|
import '../../components/Alert/Alert.js';
|
|
33
|
-
import { useDynamicContext } from '../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
|
|
34
33
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
34
|
+
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
35
|
+
import '../../store/state/authMode/authMode.js';
|
|
36
|
+
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
35
37
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
36
38
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
37
39
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
38
40
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
39
41
|
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
40
|
-
import '../../store/state/authMode/authMode.js';
|
|
41
|
-
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
42
42
|
import '../../context/VerificationContext/VerificationContext.js';
|
|
43
43
|
import 'react-dom';
|
|
44
44
|
import '../../utils/functions/compareChains/compareChains.js';
|
|
@@ -114,7 +114,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
114
114
|
|
|
115
115
|
const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = false, createMfaToken = false, deviceId, requestedScopes, }) => {
|
|
116
116
|
const { t } = useTranslation();
|
|
117
|
-
const {
|
|
117
|
+
const { handleLogOutWithReason } = useInternalDynamicContext();
|
|
118
118
|
const { clearStackAndPush, pushView, goBack, canGoBack } = useViewContext();
|
|
119
119
|
const { authenticateDevice } = useMfa();
|
|
120
120
|
const [code, setCode] = useState('');
|
|
@@ -166,7 +166,7 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
|
|
|
166
166
|
createMfaToken,
|
|
167
167
|
isInitialSetup,
|
|
168
168
|
requestedScopes,
|
|
169
|
-
}), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsx(TextButton, { onClick:
|
|
169
|
+
}), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsx(TextButton, { onClick: () => handleLogOutWithReason('mfa-verification-cancelled'), copykey: 'dyn_mfa.otp_verification_view.logout', children: t('dyn_mfa.otp_verification_view.logout') })] }))] }));
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
export { MfaVerificationView };
|
|
@@ -124,7 +124,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
|
|
|
124
124
|
|
|
125
125
|
const PasskeyIntroView = ({ chains }) => {
|
|
126
126
|
var _a;
|
|
127
|
-
const { walletConnectorOptions, environmentId,
|
|
127
|
+
const { walletConnectorOptions, environmentId, handleLogOutWithReason, user, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
128
128
|
const isEmailRecoveryFlow = ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
|
|
129
129
|
!getUserVerifiedCredentialType.getUserVerifiedCredentialType(user, sdkApiCore.JwtVerifiedCredentialFormatEnum.Email);
|
|
130
130
|
const { t } = reactI18next.useTranslation();
|
|
@@ -159,7 +159,7 @@ const PasskeyIntroView = ({ chains }) => {
|
|
|
159
159
|
}, [error]);
|
|
160
160
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_passkey_intro.title', children: t('dyn_passkey_intro.title') }) }), jsxRuntime.jsxs("div", { className: 'passkey-intro-view', children: [jsxRuntime.jsx("div", { className: 'passkey-intro-view__header', children: jsxRuntime.jsx(passkeyIntro2.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-intro-view__subtitle', copykey: 'dyn_passkey_intro.subtitle', children: t('dyn_passkey_intro.subtitle') }), errorText && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }), jsxRuntime.jsx(AuthChoiceInfo.AuthChoiceInfo, { choice: 'passkey', variant: isEmailRecoveryFlow ? 'noEmailSignup' : 'default' }), jsxRuntime.jsxs("div", { className: 'passkey-intro-view__actions', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'large', onClick: () => handleCreateEmbeddedWallet(true), dataTestId: 'setup-passkey-button', loading: isLoading && createWalletWithAuthenticator, disabled: isLoading, typographyProps: {
|
|
161
161
|
color: 'inherit',
|
|
162
|
-
}, children: jsxRuntime.jsxs("div", { className: 'passkey-intro-view__inline-button', children: [jsxRuntime.jsx(PasskeyDeviceIcon.PasskeyDeviceIcon, { size: 'small' }), jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_passkey_intro.button', children: t('dyn_passkey_intro.button') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick:
|
|
162
|
+
}, children: jsxRuntime.jsxs("div", { className: 'passkey-intro-view__inline-button', children: [jsxRuntime.jsx(PasskeyDeviceIcon.PasskeyDeviceIcon, { size: 'small' }), jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_passkey_intro.button', children: t('dyn_passkey_intro.button') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_passkey_intro.button_logout', children: t('dyn_passkey_intro.button_logout') })] })] })] }));
|
|
163
163
|
};
|
|
164
164
|
|
|
165
165
|
exports.PasskeyIntroView = PasskeyIntroView;
|
|
@@ -120,7 +120,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
|
|
|
120
120
|
|
|
121
121
|
const PasskeyIntroView = ({ chains }) => {
|
|
122
122
|
var _a;
|
|
123
|
-
const { walletConnectorOptions, environmentId,
|
|
123
|
+
const { walletConnectorOptions, environmentId, handleLogOutWithReason, user, userWithMissingInfo, } = useInternalDynamicContext();
|
|
124
124
|
const isEmailRecoveryFlow = ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
|
|
125
125
|
!getUserVerifiedCredentialType(user, JwtVerifiedCredentialFormatEnum.Email);
|
|
126
126
|
const { t } = useTranslation();
|
|
@@ -155,7 +155,7 @@ const PasskeyIntroView = ({ chains }) => {
|
|
|
155
155
|
}, [error]);
|
|
156
156
|
return (jsxs(Fragment, { children: [jsx(ModalHeader, { children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_passkey_intro.title', children: t('dyn_passkey_intro.title') }) }), jsxs("div", { className: 'passkey-intro-view', children: [jsx("div", { className: 'passkey-intro-view__header', children: jsx(SvgPasskeyIntro2, {}) }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-intro-view__subtitle', copykey: 'dyn_passkey_intro.subtitle', children: t('dyn_passkey_intro.subtitle') }), errorText && jsx(ErrorContainer, { children: errorText }), jsx(AuthChoiceInfo, { choice: 'passkey', variant: isEmailRecoveryFlow ? 'noEmailSignup' : 'default' }), jsxs("div", { className: 'passkey-intro-view__actions', children: [jsx(TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'large', onClick: () => handleCreateEmbeddedWallet(true), dataTestId: 'setup-passkey-button', loading: isLoading && createWalletWithAuthenticator, disabled: isLoading, typographyProps: {
|
|
157
157
|
color: 'inherit',
|
|
158
|
-
}, children: jsxs("div", { className: 'passkey-intro-view__inline-button', children: [jsx(PasskeyDeviceIcon, { size: 'small' }), jsx(Typography, { copykey: 'dyn_passkey_intro.button', children: t('dyn_passkey_intro.button') })] }) }), jsx(TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick:
|
|
158
|
+
}, children: jsxs("div", { className: 'passkey-intro-view__inline-button', children: [jsx(PasskeyDeviceIcon, { size: 'small' }), jsx(Typography, { copykey: 'dyn_passkey_intro.button', children: t('dyn_passkey_intro.button') })] }) }), jsx(TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_passkey_intro.button_logout', children: t('dyn_passkey_intro.button_logout') })] })] })] }));
|
|
159
159
|
};
|
|
160
160
|
|
|
161
161
|
export { PasskeyIntroView };
|
|
@@ -116,11 +116,11 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
116
116
|
|
|
117
117
|
const SmsVerification = () => {
|
|
118
118
|
const { view } = ViewContext.useViewContext();
|
|
119
|
-
const {
|
|
119
|
+
const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
120
120
|
const { t } = reactI18next.useTranslation();
|
|
121
121
|
const isLoginView = view.type === 'login-with-sms-verification';
|
|
122
122
|
const { error, formattedPhone, isLoading, isValid, onSubmit, retryOneTimePassword, setError, } = useSmsVerification.useSmsVerification(isLoginView ? 'login' : 'verify-only');
|
|
123
|
-
const LogoutButton = !isLoginView ? (jsxRuntime.jsx(TextButton.TextButton, { className: 'sms-verification__log-out', onClick:
|
|
123
|
+
const LogoutButton = !isLoginView ? (jsxRuntime.jsx(TextButton.TextButton, { className: 'sms-verification__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') })) : undefined;
|
|
124
124
|
return (jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { MainIcon: PhoneIcon.PhoneIcon, displayedDestination: formattedPhone, error: error, hideHeader: true, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid, retryHandler: retryOneTimePassword, onPinChange: () => setError(undefined), appendToEnd: LogoutButton }));
|
|
125
125
|
};
|
|
126
126
|
|
|
@@ -112,11 +112,11 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
112
112
|
|
|
113
113
|
const SmsVerification = () => {
|
|
114
114
|
const { view } = useViewContext();
|
|
115
|
-
const {
|
|
115
|
+
const { handleLogOutWithReason } = useInternalDynamicContext();
|
|
116
116
|
const { t } = useTranslation();
|
|
117
117
|
const isLoginView = view.type === 'login-with-sms-verification';
|
|
118
118
|
const { error, formattedPhone, isLoading, isValid, onSubmit, retryOneTimePassword, setError, } = useSmsVerification(isLoginView ? 'login' : 'verify-only');
|
|
119
|
-
const LogoutButton = !isLoginView ? (jsx(TextButton, { className: 'sms-verification__log-out', onClick:
|
|
119
|
+
const LogoutButton = !isLoginView ? (jsx(TextButton, { className: 'sms-verification__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') })) : undefined;
|
|
120
120
|
return (jsx(OTPVerificationView, { MainIcon: PhoneIcon, displayedDestination: formattedPhone, error: error, hideHeader: true, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid, retryHandler: retryOneTimePassword, onPinChange: () => setError(undefined), appendToEnd: LogoutButton }));
|
|
121
121
|
};
|
|
122
122
|
|
|
@@ -37,7 +37,7 @@ require('../../../utils/constants/values.cjs');
|
|
|
37
37
|
var AgreementSection = require('./AgreementSection.cjs');
|
|
38
38
|
|
|
39
39
|
const WalletDelegationView = ({ wallets, }) => {
|
|
40
|
-
const { setShowAuthFlow,
|
|
40
|
+
const { setShowAuthFlow, handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
41
41
|
const { user } = useDynamicContext.useDynamicContext();
|
|
42
42
|
const appName = settingsUtils.useAppName();
|
|
43
43
|
const { getWalletsToDelegate, delegateKeyShares } = useWalletDelegation.useWalletDelegation();
|
|
@@ -289,7 +289,7 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
289
289
|
color: 'primary',
|
|
290
290
|
weight: 'bold',
|
|
291
291
|
}, onClick: () => {
|
|
292
|
-
|
|
292
|
+
handleLogOutWithReason('user-intent');
|
|
293
293
|
}, dataTestId: 'embedded-delegation-logout-button', copykey: 'dyn_wallet_delegation.logout_button', style: {
|
|
294
294
|
backgroundColor: 'var(--dynamic-base-2)',
|
|
295
295
|
border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
|
|
@@ -33,7 +33,7 @@ import '../../../utils/constants/values.js';
|
|
|
33
33
|
import { AgreementSection } from './AgreementSection.js';
|
|
34
34
|
|
|
35
35
|
const WalletDelegationView = ({ wallets, }) => {
|
|
36
|
-
const { setShowAuthFlow,
|
|
36
|
+
const { setShowAuthFlow, handleLogOutWithReason } = useInternalDynamicContext();
|
|
37
37
|
const { user } = useDynamicContext();
|
|
38
38
|
const appName = useAppName();
|
|
39
39
|
const { getWalletsToDelegate, delegateKeyShares } = useWalletDelegation();
|
|
@@ -285,7 +285,7 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
285
285
|
color: 'primary',
|
|
286
286
|
weight: 'bold',
|
|
287
287
|
}, onClick: () => {
|
|
288
|
-
|
|
288
|
+
handleLogOutWithReason('user-intent');
|
|
289
289
|
}, dataTestId: 'embedded-delegation-logout-button', copykey: 'dyn_wallet_delegation.logout_button', style: {
|
|
290
290
|
backgroundColor: 'var(--dynamic-base-2)',
|
|
291
291
|
border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
|