@dynamic-labs/sdk-react-core 3.0.0-alpha.31 → 3.0.0-alpha.33

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.
Files changed (105) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +12 -12
  5. package/src/index.cjs +2 -0
  6. package/src/index.d.ts +1 -0
  7. package/src/index.js +1 -0
  8. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +2 -2
  9. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +2 -2
  10. package/src/lib/components/SyncAuthFlow/SyncAuthFlow.cjs +2 -0
  11. package/src/lib/components/SyncAuthFlow/SyncAuthFlow.js +2 -0
  12. package/src/lib/context/DynamicContext/DynamicContext.cjs +17 -11
  13. package/src/lib/context/DynamicContext/DynamicContext.js +17 -11
  14. package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +1 -2
  15. package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.cjs +2 -2
  16. package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.d.ts +1 -1
  17. package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.js +2 -2
  18. package/src/lib/context/PhantomRedirectContext/useResponseHandlers.cjs +3 -3
  19. package/src/lib/context/PhantomRedirectContext/useResponseHandlers.js +3 -3
  20. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +5 -6
  21. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +5 -6
  22. package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +1 -1
  23. package/src/lib/data/api/embeddedWallets/embeddedWallets.js +2 -2
  24. package/src/lib/data/api/embeddedWallets/types.d.ts +2 -2
  25. package/src/lib/data/api/externalAuth/externalAuth.cjs +20 -0
  26. package/src/lib/data/api/externalAuth/externalAuth.d.ts +4 -0
  27. package/src/lib/data/api/externalAuth/externalAuth.js +20 -1
  28. package/src/lib/events/auth.d.ts +12 -0
  29. package/src/lib/shared/utils/functions/hasPendingMfaAction/hasPendingMfaAction.cjs +14 -0
  30. package/src/lib/shared/utils/functions/hasPendingMfaAction/hasPendingMfaAction.d.ts +2 -0
  31. package/src/lib/shared/utils/functions/hasPendingMfaAction/hasPendingMfaAction.js +10 -0
  32. package/src/lib/shared/utils/functions/hasPendingMfaAction/index.d.ts +1 -0
  33. package/src/lib/shared/utils/functions/index.d.ts +1 -0
  34. package/src/lib/store/hooks/useUser/useUser.cjs +24 -6
  35. package/src/lib/store/hooks/useUser/useUser.d.ts +6 -3
  36. package/src/lib/store/hooks/useUser/useUser.js +24 -6
  37. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +1 -1
  38. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +1 -1
  39. package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.cjs +3 -3
  40. package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.js +3 -3
  41. package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.cjs +2 -0
  42. package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +1 -1
  43. package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.js +2 -0
  44. package/src/lib/utils/hooks/index.d.ts +2 -0
  45. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +2 -1
  46. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +2 -1
  47. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +3 -1
  48. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.d.ts +2 -2
  49. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +4 -2
  50. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +2 -2
  51. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +2 -2
  52. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +2 -2
  53. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +1 -1
  54. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.d.ts +2 -2
  55. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +2 -2
  56. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.d.ts +3 -3
  57. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.d.ts +2 -2
  58. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.d.ts +2 -2
  59. package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.cjs +30 -1
  60. package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.d.ts +1 -0
  61. package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.js +31 -2
  62. package/src/lib/utils/hooks/useMfa/useMfa.cjs +8 -28
  63. package/src/lib/utils/hooks/useMfa/useMfa.d.ts +1 -7
  64. package/src/lib/utils/hooks/useMfa/useMfa.js +8 -28
  65. package/src/lib/utils/hooks/useResetCookieLocalStorage/index.d.ts +1 -0
  66. package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.cjs +143 -0
  67. package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.d.ts +8 -0
  68. package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.js +139 -0
  69. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +4 -2
  70. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +8 -2
  71. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +4 -2
  72. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +6 -5
  73. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.d.ts +2 -1
  74. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +6 -5
  75. package/src/lib/utils/hooks/useSyncMfaFlow/index.d.ts +1 -0
  76. package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.cjs +152 -0
  77. package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.d.ts +4 -0
  78. package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.js +148 -0
  79. package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.cjs +9 -7
  80. package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.js +9 -7
  81. package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +8 -14
  82. package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +8 -14
  83. package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +3 -3
  84. package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +3 -3
  85. package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +4 -4
  86. package/src/lib/views/CollectUserDataView/CollectUserDataView.js +4 -4
  87. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +3 -3
  88. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +3 -3
  89. package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.cjs +3 -3
  90. package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.js +3 -3
  91. package/src/lib/views/EmailVerification/EmailVerification.cjs +4 -4
  92. package/src/lib/views/EmailVerification/EmailVerification.js +4 -4
  93. package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +2 -2
  94. package/src/lib/views/MfaVerificationView/MfaVerificationView.js +2 -2
  95. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +2 -2
  96. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.d.ts +2 -2
  97. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +2 -2
  98. package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.d.ts +2 -2
  99. package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +3 -3
  100. package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +3 -3
  101. package/src/lib/views/viewToComponentMap.d.ts +1 -1
  102. package/src/lib/context/DynamicContext/hooks/useIsAuthenticated/index.d.ts +0 -1
  103. package/src/lib/context/DynamicContext/hooks/useIsAuthenticated/useIsAuthenticated.cjs +0 -8
  104. package/src/lib/context/DynamicContext/hooks/useIsAuthenticated/useIsAuthenticated.d.ts +0 -2
  105. package/src/lib/context/DynamicContext/hooks/useIsAuthenticated/useIsAuthenticated.js +0 -4
@@ -19,6 +19,7 @@ require('../../constants/colors.cjs');
19
19
  require('../../constants/values.cjs');
20
20
  require('../../../shared/utils/classes/storage/localStorage.cjs');
21
21
  require('../../../shared/utils/classes/storage/sessionStorage.cjs');
22
+ var hasPendingMfaAction = require('../../../shared/utils/functions/hasPendingMfaAction/hasPendingMfaAction.cjs');
22
23
  require('../../../shared/consts/index.cjs');
23
24
  require('../../../events/dynamicEvents.cjs');
24
25
  require('../../../context/CaptchaContext/CaptchaContext.cjs');
@@ -27,7 +28,6 @@ require('@dynamic-labs/multi-wallet');
27
28
  require('react-international-phone');
28
29
  require('../../../config/ApiEndpoint.cjs');
29
30
  var storeAuthTokenAndUser = require('../../../store/utils/storeAuthTokenAndUser/storeAuthTokenAndUser.cjs');
30
- var mfa = require('../../../data/api/mfa/mfa.cjs');
31
31
  require('../../../locale/locale.cjs');
32
32
  require('@dynamic-labs/store');
33
33
  var AccessDeniedContext = require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
@@ -95,7 +95,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
95
95
 
96
96
  const sleepToShowSuccessMessage = () => utils.sleep(1500);
97
97
  const useUserAuth = ({ authMethod, }) => {
98
- const { handleLogOut, setShowAuthFlow, setCallback, setMultiWalletWidgetState, environmentId, walletConnectorOptions, } = useInternalDynamicContext.useInternalDynamicContext();
98
+ const { handleLogOut, setShowAuthFlow, setCallback, setMultiWalletWidgetState, walletConnectorOptions, } = useInternalDynamicContext.useInternalDynamicContext();
99
99
  const { setDeniedOauthUsername, setDeniedOauthProvider } = AccessDeniedContext.useAccessDeniedContext();
100
100
  const { view, setView, goToInitialView } = ViewContext.useViewContext();
101
101
  const { setLoading } = LoadingContext.useLoadingContext();
@@ -105,7 +105,7 @@ const useUserAuth = ({ authMethod, }) => {
105
105
  const { shouldAutoCreateEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
106
106
  const isVerifyResponse = (response) => response.user;
107
107
  const initAuth = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ isSignIn = true, verifyFunction, onVerifySuccess, onSettled, onError, showSuccessMessage = false, skipDefaultErrorHandling = false, }) {
108
- var _b, _c;
108
+ var _b;
109
109
  logger.logger.debug('initAuth', { authMethod, isSignIn });
110
110
  try {
111
111
  // TODO: change this logic to const verifiedUser = await verifyFunction();
@@ -126,17 +126,11 @@ const useUserAuth = ({ authMethod, }) => {
126
126
  walletConnectorOptions.forEach((walletOption) => {
127
127
  walletOption.walletConnector.setVerifiedCredentials(verifiedUser.verifiedCredentials);
128
128
  });
129
- if ((_b = verifiedUser.scope) === null || _b === void 0 ? void 0 : _b.includes('requiresAdditionalAuth')) {
130
- const devices = yield mfa.getUserMfaDevices({ environmentId });
131
- if (devices.length === 0) {
132
- setView('mfa-choose-device');
133
- }
134
- else {
135
- setView('mfa-verification');
136
- }
129
+ if (hasPendingMfaAction.hasPendingMfaAction(verifiedUser)) {
130
+ // handled in SyncAuthFlow
137
131
  return;
138
132
  }
139
- if (isSignIn && ((_c = verifiedUser.missingFields) === null || _c === void 0 ? void 0 : _c.length)) {
133
+ if (isSignIn && ((_b = verifiedUser.missingFields) === null || _b === void 0 ? void 0 : _b.length)) {
140
134
  //onboarding will be handled in the onboarding flow
141
135
  return;
142
136
  }
@@ -213,7 +207,7 @@ const useUserAuth = ({ authMethod, }) => {
213
207
  setError(error.message);
214
208
  }
215
209
  };
216
- const handleVerifyMissingFields = (_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({ missingFields, isEmailVerificationRequired, isSmsVerificationRequired, }) {
210
+ const handleVerifyMissingFields = (_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ missingFields, isEmailVerificationRequired, isSmsVerificationRequired, }) {
217
211
  if (isEmailVerificationRequired &&
218
212
  missingFields.find((field) => field.name === 'email')) {
219
213
  setView('verify-email');
@@ -226,7 +220,7 @@ const useUserAuth = ({ authMethod, }) => {
226
220
  }
227
221
  setView(view.type);
228
222
  });
229
- const completeAuth = (_e) => _tslib.__awaiter(void 0, [_e], void 0, function* ({ completeSignInFlow, updateJwtFunction, onValidUpdatedJwt, options = {}, }) {
223
+ const completeAuth = (_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({ completeSignInFlow, updateJwtFunction, onValidUpdatedJwt, options = {}, }) {
230
224
  logger.logger.debug('completeAuth', { authMethod });
231
225
  try {
232
226
  const { updateUserProfileResponse, isSmsVerificationRequired, isEmailVerificationRequired, missingFields, } = yield updateJwtFunction();
@@ -15,6 +15,7 @@ import '../../constants/colors.js';
15
15
  import '../../constants/values.js';
16
16
  import '../../../shared/utils/classes/storage/localStorage.js';
17
17
  import '../../../shared/utils/classes/storage/sessionStorage.js';
18
+ import { hasPendingMfaAction } from '../../../shared/utils/functions/hasPendingMfaAction/hasPendingMfaAction.js';
18
19
  import '../../../shared/consts/index.js';
19
20
  import '../../../events/dynamicEvents.js';
20
21
  import '../../../context/CaptchaContext/CaptchaContext.js';
@@ -23,7 +24,6 @@ import '@dynamic-labs/multi-wallet';
23
24
  import 'react-international-phone';
24
25
  import '../../../config/ApiEndpoint.js';
25
26
  import { storeAuthTokenAndUser } from '../../../store/utils/storeAuthTokenAndUser/storeAuthTokenAndUser.js';
26
- import { getUserMfaDevices } from '../../../data/api/mfa/mfa.js';
27
27
  import '../../../locale/locale.js';
28
28
  import '@dynamic-labs/store';
29
29
  import { useAccessDeniedContext } from '../../../context/AccessDeniedContext/AccessDeniedContext.js';
@@ -91,7 +91,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
91
91
 
92
92
  const sleepToShowSuccessMessage = () => sleep(1500);
93
93
  const useUserAuth = ({ authMethod, }) => {
94
- const { handleLogOut, setShowAuthFlow, setCallback, setMultiWalletWidgetState, environmentId, walletConnectorOptions, } = useInternalDynamicContext();
94
+ const { handleLogOut, setShowAuthFlow, setCallback, setMultiWalletWidgetState, walletConnectorOptions, } = useInternalDynamicContext();
95
95
  const { setDeniedOauthUsername, setDeniedOauthProvider } = useAccessDeniedContext();
96
96
  const { view, setView, goToInitialView } = useViewContext();
97
97
  const { setLoading } = useLoadingContext();
@@ -101,7 +101,7 @@ const useUserAuth = ({ authMethod, }) => {
101
101
  const { shouldAutoCreateEmbeddedWallet } = useEmbeddedWallet();
102
102
  const isVerifyResponse = (response) => response.user;
103
103
  const initAuth = (_a) => __awaiter(void 0, [_a], void 0, function* ({ isSignIn = true, verifyFunction, onVerifySuccess, onSettled, onError, showSuccessMessage = false, skipDefaultErrorHandling = false, }) {
104
- var _b, _c;
104
+ var _b;
105
105
  logger.debug('initAuth', { authMethod, isSignIn });
106
106
  try {
107
107
  // TODO: change this logic to const verifiedUser = await verifyFunction();
@@ -122,17 +122,11 @@ const useUserAuth = ({ authMethod, }) => {
122
122
  walletConnectorOptions.forEach((walletOption) => {
123
123
  walletOption.walletConnector.setVerifiedCredentials(verifiedUser.verifiedCredentials);
124
124
  });
125
- if ((_b = verifiedUser.scope) === null || _b === void 0 ? void 0 : _b.includes('requiresAdditionalAuth')) {
126
- const devices = yield getUserMfaDevices({ environmentId });
127
- if (devices.length === 0) {
128
- setView('mfa-choose-device');
129
- }
130
- else {
131
- setView('mfa-verification');
132
- }
125
+ if (hasPendingMfaAction(verifiedUser)) {
126
+ // handled in SyncAuthFlow
133
127
  return;
134
128
  }
135
- if (isSignIn && ((_c = verifiedUser.missingFields) === null || _c === void 0 ? void 0 : _c.length)) {
129
+ if (isSignIn && ((_b = verifiedUser.missingFields) === null || _b === void 0 ? void 0 : _b.length)) {
136
130
  //onboarding will be handled in the onboarding flow
137
131
  return;
138
132
  }
@@ -209,7 +203,7 @@ const useUserAuth = ({ authMethod, }) => {
209
203
  setError(error.message);
210
204
  }
211
205
  };
212
- const handleVerifyMissingFields = (_d) => __awaiter(void 0, [_d], void 0, function* ({ missingFields, isEmailVerificationRequired, isSmsVerificationRequired, }) {
206
+ const handleVerifyMissingFields = (_c) => __awaiter(void 0, [_c], void 0, function* ({ missingFields, isEmailVerificationRequired, isSmsVerificationRequired, }) {
213
207
  if (isEmailVerificationRequired &&
214
208
  missingFields.find((field) => field.name === 'email')) {
215
209
  setView('verify-email');
@@ -222,7 +216,7 @@ const useUserAuth = ({ authMethod, }) => {
222
216
  }
223
217
  setView(view.type);
224
218
  });
225
- const completeAuth = (_e) => __awaiter(void 0, [_e], void 0, function* ({ completeSignInFlow, updateJwtFunction, onValidUpdatedJwt, options = {}, }) {
219
+ const completeAuth = (_d) => __awaiter(void 0, [_d], void 0, function* ({ completeSignInFlow, updateJwtFunction, onValidUpdatedJwt, options = {}, }) {
226
220
  logger.debug('completeAuth', { authMethod });
227
221
  try {
228
222
  const { updateUserProfileResponse, isSmsVerificationRequired, isEmailVerificationRequired, missingFields, } = yield updateJwtFunction();
@@ -92,7 +92,7 @@ require('../../../../context/ReinitializeContext/ReinitializeContextProvider.cjs
92
92
  var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
93
93
 
94
94
  const useUpdateUser = (validationSchemaStripUnknown) => {
95
- const { environmentId, unauthenticatedUser, setCallback } = useInternalDynamicContext.useInternalDynamicContext();
95
+ const { environmentId, userWithMissingInfo, setCallback } = useInternalDynamicContext.useInternalDynamicContext();
96
96
  const { setRetryData } = VerificationContext.useVerification();
97
97
  const { selectedPhoneCountry } = FieldsStateContext.useFieldsState();
98
98
  const handleVerificationRequired = useHandleVerificationRequired.useHandleVerificationRequired();
@@ -103,7 +103,7 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
103
103
  let { metadata } = userFields;
104
104
  // when a user has already logged in but a custom field was added to env, in order to not clear the old fields
105
105
  metadata = metadata
106
- ? Object.assign(Object.assign({}, unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.metadata), metadata) : unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.metadata;
106
+ ? Object.assign(Object.assign({}, userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.metadata), metadata) : userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.metadata;
107
107
  // we dont add user.metadata from edit profile because it is already in the metadata request for updateUser
108
108
  const validatedUserFields = yield userFieldsSchema.userFieldsSchema.validate(userFields, {
109
109
  stripUnknown: validationSchemaStripUnknown,
@@ -136,7 +136,7 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
136
136
  updateUserProfileResponse,
137
137
  };
138
138
  }), [
139
- unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.metadata,
139
+ userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.metadata,
140
140
  validationSchemaStripUnknown,
141
141
  selectedPhoneCountry,
142
142
  setRetryData,
@@ -88,7 +88,7 @@ import '../../../../context/ReinitializeContext/ReinitializeContextProvider.js';
88
88
  import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
89
89
 
90
90
  const useUpdateUser = (validationSchemaStripUnknown) => {
91
- const { environmentId, unauthenticatedUser, setCallback } = useInternalDynamicContext();
91
+ const { environmentId, userWithMissingInfo, setCallback } = useInternalDynamicContext();
92
92
  const { setRetryData } = useVerification();
93
93
  const { selectedPhoneCountry } = useFieldsState();
94
94
  const handleVerificationRequired = useHandleVerificationRequired();
@@ -99,7 +99,7 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
99
99
  let { metadata } = userFields;
100
100
  // when a user has already logged in but a custom field was added to env, in order to not clear the old fields
101
101
  metadata = metadata
102
- ? Object.assign(Object.assign({}, unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.metadata), metadata) : unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.metadata;
102
+ ? Object.assign(Object.assign({}, userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.metadata), metadata) : userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.metadata;
103
103
  // we dont add user.metadata from edit profile because it is already in the metadata request for updateUser
104
104
  const validatedUserFields = yield userFieldsSchema.validate(userFields, {
105
105
  stripUnknown: validationSchemaStripUnknown,
@@ -132,7 +132,7 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
132
132
  updateUserProfileResponse,
133
133
  };
134
134
  }), [
135
- unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.metadata,
135
+ userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.metadata,
136
136
  validationSchemaStripUnknown,
137
137
  selectedPhoneCountry,
138
138
  setRetryData,
@@ -103,19 +103,19 @@ require('qrcode');
103
103
 
104
104
  const CollectUserDataView = () => {
105
105
  var _a;
106
- const { appName, projectSettings, network, selectedWalletConnector: walletConnector, handleLogOut, onboardingImageUrl, unauthenticatedUser, } = useInternalDynamicContext.useInternalDynamicContext();
106
+ const { appName, projectSettings, network, selectedWalletConnector: walletConnector, handleLogOut, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
107
107
  const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
108
108
  const nameService = useFetchNameService.useFetchNameService();
109
109
  const { t } = reactI18next.useTranslation();
110
- if (!walletConnector || !unauthenticatedUser) {
110
+ if (!walletConnector || !userWithMissingInfo) {
111
111
  return null;
112
112
  }
113
113
  const evmNetworks = walletConnector.evmNetworks || [];
114
114
  const _isSupportedNetwork = !network || isSupportedNetwork.isSupportedNetwork({ network, walletConnector });
115
- const walletAddress = (_a = unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.verifiedCredentials.find((verifiedCredential) => verifiedCredential.id === unauthenticatedUser.lastVerifiedCredentialId)) === null || _a === void 0 ? void 0 : _a.address;
115
+ const walletAddress = (_a = userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.verifiedCredentials.find((verifiedCredential) => verifiedCredential.id === userWithMissingInfo.lastVerifiedCredentialId)) === null || _a === void 0 ? void 0 : _a.address;
116
116
  return (jsxRuntime.jsxs("div", { className: 'collect-user-data', "data-testid": 'collect-user-data-view', children: [jsxRuntime.jsxs("div", { className: 'collect-user-data__network-container', children: [jsxRuntime.jsxs("div", { className: 'collect-user-data__img-container', children: [(nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsxRuntime.jsx("img", { src: nameService.avatar, alt: '', className: 'collect-user-data__img collect-user-data__img--rounded' })) : (jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { iconSize: 28 })), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data__wallet-address', children: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || shortenWalletAddress.shortenWalletAddress(walletAddress, 3, 3) })] }), jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, evmNetworks: evmNetworks, connector: walletConnector, showNetworkName: true, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, buttonClassName: 'collect-user-data__network-picker-button', mainClassName: 'collect-user-data__network-picker' })] }), onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { withIcon: false, className: 'collect-user-data__error--not-supported', copykey: 'dyn_collect_user_data.not_supported_network.error_message', children: t('dyn_collect_user_data.not_supported_network.error_message') })), jsxRuntime.jsxs("div", { className: classNames.classNames('collect-user-data__form', {
117
117
  'collect-user-data__form--error': !_isSupportedNetwork,
118
- }), children: [jsxRuntime.jsx("div", { className: 'collect-user-data__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { disableSubmit: !_isSupportedNetwork, userProfile: unauthenticatedUser, children: !_isSupportedNetwork ? (jsxRuntime.jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.not_supported_network.title', children: t('dyn_collect_user_data.not_supported_network.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.not_supported_network.description', children: t('dyn_collect_user_data.not_supported_network.description') })] })) : (jsxRuntime.jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
118
+ }), children: [jsxRuntime.jsx("div", { className: 'collect-user-data__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { disableSubmit: !_isSupportedNetwork, userProfile: userWithMissingInfo, children: !_isSupportedNetwork ? (jsxRuntime.jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.not_supported_network.title', children: t('dyn_collect_user_data.not_supported_network.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.not_supported_network.description', children: t('dyn_collect_user_data.not_supported_network.description') })] })) : (jsxRuntime.jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
119
119
  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) ||
120
120
  t('dyn_collect_user_data.description') })] })) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
121
121
  };
@@ -99,19 +99,19 @@ import 'qrcode';
99
99
 
100
100
  const CollectUserDataView = () => {
101
101
  var _a;
102
- const { appName, projectSettings, network, selectedWalletConnector: walletConnector, handleLogOut, onboardingImageUrl, unauthenticatedUser, } = useInternalDynamicContext();
102
+ const { appName, projectSettings, network, selectedWalletConnector: walletConnector, handleLogOut, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext();
103
103
  const [isNetworkPickerOpen, setIsNetworkPickerOpen] = useState(false);
104
104
  const nameService = useFetchNameService();
105
105
  const { t } = useTranslation();
106
- if (!walletConnector || !unauthenticatedUser) {
106
+ if (!walletConnector || !userWithMissingInfo) {
107
107
  return null;
108
108
  }
109
109
  const evmNetworks = walletConnector.evmNetworks || [];
110
110
  const _isSupportedNetwork = !network || isSupportedNetwork({ network, walletConnector });
111
- const walletAddress = (_a = unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.verifiedCredentials.find((verifiedCredential) => verifiedCredential.id === unauthenticatedUser.lastVerifiedCredentialId)) === null || _a === void 0 ? void 0 : _a.address;
111
+ const walletAddress = (_a = userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.verifiedCredentials.find((verifiedCredential) => verifiedCredential.id === userWithMissingInfo.lastVerifiedCredentialId)) === null || _a === void 0 ? void 0 : _a.address;
112
112
  return (jsxs("div", { className: 'collect-user-data', "data-testid": 'collect-user-data-view', children: [jsxs("div", { className: 'collect-user-data__network-container', children: [jsxs("div", { className: 'collect-user-data__img-container', children: [(nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsx("img", { src: nameService.avatar, alt: '', className: 'collect-user-data__img collect-user-data__img--rounded' })) : (jsx(AuthProviderIcon, { iconSize: 28 })), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data__wallet-address', children: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || shortenWalletAddress(walletAddress, 3, 3) })] }), jsx(NetworkPicker, { currentNetwork: network, evmNetworks: evmNetworks, connector: walletConnector, showNetworkName: true, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, buttonClassName: 'collect-user-data__network-picker-button', mainClassName: 'collect-user-data__network-picker' })] }), onboardingImageUrl && (jsx("img", { className: 'collect-user-data__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsx(ErrorContainer, { withIcon: false, className: 'collect-user-data__error--not-supported', copykey: 'dyn_collect_user_data.not_supported_network.error_message', children: t('dyn_collect_user_data.not_supported_network.error_message') })), jsxs("div", { className: classNames('collect-user-data__form', {
113
113
  'collect-user-data__form--error': !_isSupportedNetwork,
114
- }), children: [jsx("div", { className: 'collect-user-data__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { disableSubmit: !_isSupportedNetwork, userProfile: unauthenticatedUser, children: !_isSupportedNetwork ? (jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.not_supported_network.title', children: t('dyn_collect_user_data.not_supported_network.title') }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.not_supported_network.description', children: t('dyn_collect_user_data.not_supported_network.description') })] })) : (jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
114
+ }), children: [jsx("div", { className: 'collect-user-data__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { disableSubmit: !_isSupportedNetwork, userProfile: userWithMissingInfo, children: !_isSupportedNetwork ? (jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.not_supported_network.title', children: t('dyn_collect_user_data.not_supported_network.title') }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.not_supported_network.description', children: t('dyn_collect_user_data.not_supported_network.description') })] })) : (jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
115
115
  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) ||
116
116
  t('dyn_collect_user_data.description') })] })) }), jsx(TextButton, { className: 'collect-user-data__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
117
117
  };
@@ -95,7 +95,7 @@ require('../../../components/InlineWidget/InlineWidget.cjs');
95
95
  require('qrcode');
96
96
 
97
97
  const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
98
- const { policiesConsentInnerComponent, unauthenticatedUser } = useInternalDynamicContext.useInternalDynamicContext();
98
+ const { policiesConsentInnerComponent, userWithMissingInfo } = useInternalDynamicContext.useInternalDynamicContext();
99
99
  const { error } = ErrorContext.useErrorContext();
100
100
  const { completeAuth } = useUserAuth.useUserAuth({});
101
101
  const { updateUser } = useUserUpdateRequest.useUserUpdateRequestInternal({
@@ -107,7 +107,7 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
107
107
  });
108
108
  }), [completeAuth, updateUser]);
109
109
  const { fetch: loading, formikInitialValues, formikValidationSchema, enforcePolicies, onFormSubmit, } = useUserDataForm.useUserDataForm({
110
- fields: (unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.missingFields) || [],
110
+ fields: (userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.missingFields) || [],
111
111
  onSubmit,
112
112
  userProfile,
113
113
  });
@@ -120,7 +120,7 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
120
120
  (enforcePolicies &&
121
121
  (policiesConsentInnerComponentArray === null || policiesConsentInnerComponentArray === void 0 ? void 0 : policiesConsentInnerComponentArray.length) !==
122
122
  ((_a = values.policiesConsentArray) === null || _a === void 0 ? void 0 : _a.length));
123
- return (jsxRuntime.jsx(formik.Form, { className: 'user-data-form__form', children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [children, error && (jsxRuntime.jsx(Alert.Alert, { icon: 'error', variant: 'error', className: 'user-data-form__error', children: error })), jsxRuntime.jsx(UserDataFields.UserDataFields, { fields: unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.missingFields, errors: errors, touched: touched, policiesConsentInnerComponentArray: policiesConsentInnerComponentArray }), jsxRuntime.jsx(TypographyButton.TypographyButton, { type: 'submit', loading: loading, disabled: isSubmitBtnDisabled, buttonVariant: 'primary', expanded: true, buttonPadding: 'login-screen-height', children: "Continue" })] }) }));
123
+ return (jsxRuntime.jsx(formik.Form, { className: 'user-data-form__form', children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [children, error && (jsxRuntime.jsx(Alert.Alert, { icon: 'error', variant: 'error', className: 'user-data-form__error', children: error })), jsxRuntime.jsx(UserDataFields.UserDataFields, { fields: userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.missingFields, errors: errors, touched: touched, policiesConsentInnerComponentArray: policiesConsentInnerComponentArray }), jsxRuntime.jsx(TypographyButton.TypographyButton, { type: 'submit', loading: loading, disabled: isSubmitBtnDisabled, buttonVariant: 'primary', expanded: true, buttonPadding: 'login-screen-height', children: "Continue" })] }) }));
124
124
  } }));
125
125
  };
126
126
 
@@ -91,7 +91,7 @@ import '../../../components/InlineWidget/InlineWidget.js';
91
91
  import 'qrcode';
92
92
 
93
93
  const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
94
- const { policiesConsentInnerComponent, unauthenticatedUser } = useInternalDynamicContext();
94
+ const { policiesConsentInnerComponent, userWithMissingInfo } = useInternalDynamicContext();
95
95
  const { error } = useErrorContext();
96
96
  const { completeAuth } = useUserAuth({});
97
97
  const { updateUser } = useUserUpdateRequestInternal({
@@ -103,7 +103,7 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
103
103
  });
104
104
  }), [completeAuth, updateUser]);
105
105
  const { fetch: loading, formikInitialValues, formikValidationSchema, enforcePolicies, onFormSubmit, } = useUserDataForm({
106
- fields: (unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.missingFields) || [],
106
+ fields: (userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.missingFields) || [],
107
107
  onSubmit,
108
108
  userProfile,
109
109
  });
@@ -116,7 +116,7 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
116
116
  (enforcePolicies &&
117
117
  (policiesConsentInnerComponentArray === null || policiesConsentInnerComponentArray === void 0 ? void 0 : policiesConsentInnerComponentArray.length) !==
118
118
  ((_a = values.policiesConsentArray) === null || _a === void 0 ? void 0 : _a.length));
119
- return (jsx(Form, { className: 'user-data-form__form', children: jsxs(Fragment, { children: [children, error && (jsx(Alert, { icon: 'error', variant: 'error', className: 'user-data-form__error', children: error })), jsx(UserDataFields, { fields: unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.missingFields, errors: errors, touched: touched, policiesConsentInnerComponentArray: policiesConsentInnerComponentArray }), jsx(TypographyButton, { type: 'submit', loading: loading, disabled: isSubmitBtnDisabled, buttonVariant: 'primary', expanded: true, buttonPadding: 'login-screen-height', children: "Continue" })] }) }));
119
+ return (jsx(Form, { className: 'user-data-form__form', children: jsxs(Fragment, { children: [children, error && (jsx(Alert, { icon: 'error', variant: 'error', className: 'user-data-form__error', children: error })), jsx(UserDataFields, { fields: userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.missingFields, errors: errors, touched: touched, policiesConsentInnerComponentArray: policiesConsentInnerComponentArray }), jsx(TypographyButton, { type: 'submit', loading: loading, disabled: isSubmitBtnDisabled, buttonVariant: 'primary', expanded: true, buttonPadding: 'login-screen-height', children: "Continue" })] }) }));
120
120
  } }));
121
121
  };
122
122
 
@@ -98,12 +98,12 @@ require('qrcode');
98
98
 
99
99
  const CollectUserDataViewNoWallet = ({ userIdentification, userIdentificationOverride }) => {
100
100
  var _a;
101
- const { appName, handleLogOut, projectSettings, onboardingImageUrl, unauthenticatedUser, } = useInternalDynamicContext.useInternalDynamicContext();
101
+ const { appName, handleLogOut, projectSettings, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
102
102
  const { t } = reactI18next.useTranslation();
103
- if (!unauthenticatedUser) {
103
+ if (!userWithMissingInfo) {
104
104
  return null;
105
105
  }
106
- 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: unauthenticatedUser }) }), 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 : unauthenticatedUser[userIdentification]) !== null && _a !== void 0 ? _a : getUserIdentifier.getUserIdentifier(unauthenticatedUser) })] }), 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: unauthenticatedUser, 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) ||
106
+ 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) ||
107
107
  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) ||
108
108
  t('dyn_collect_user_data.description') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
109
109
  };
@@ -94,12 +94,12 @@ import 'qrcode';
94
94
 
95
95
  const CollectUserDataViewNoWallet = ({ userIdentification, userIdentificationOverride }) => {
96
96
  var _a;
97
- const { appName, handleLogOut, projectSettings, onboardingImageUrl, unauthenticatedUser, } = useInternalDynamicContext();
97
+ const { appName, handleLogOut, projectSettings, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext();
98
98
  const { t } = useTranslation();
99
- if (!unauthenticatedUser) {
99
+ if (!userWithMissingInfo) {
100
100
  return null;
101
101
  }
102
- 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: unauthenticatedUser }) }), 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 : unauthenticatedUser[userIdentification]) !== null && _a !== void 0 ? _a : getUserIdentifier(unauthenticatedUser) })] }), 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: unauthenticatedUser, 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) ||
102
+ 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) ||
103
103
  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) ||
104
104
  t('dyn_collect_user_data.description') })] }) }), jsx(TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
105
105
  };
@@ -114,7 +114,7 @@ require('qrcode');
114
114
  const SECONDS_TO_RETRY = 15;
115
115
  const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _showRetryButton = true, showTransferMessage: _showTransferMessage = false, }) => {
116
116
  var _a, _b, _c, _d;
117
- const { environmentId, handleLogOut, setPrimaryWalletId, setShowAuthFlow, projectSettings, user, unauthenticatedUser, walletConnectorOptions, walletConnector, } = useInternalDynamicContext.useInternalDynamicContext();
117
+ const { environmentId, handleLogOut, setPrimaryWalletId, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, walletConnector, } = useInternalDynamicContext.useInternalDynamicContext();
118
118
  const { setView, goToInitialView } = ViewContext.useViewContext();
119
119
  const { error, setError, setErrorMessage } = ErrorContext.useErrorContext();
120
120
  const { loading, setLoading } = LoadingContext.useLoadingContext();
@@ -236,7 +236,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
236
236
  if (!verificationUUID) {
237
237
  return cancelAuth();
238
238
  }
239
- if (!user && !unauthenticatedUser) {
239
+ if (!user && !userWithMissingInfo) {
240
240
  return initAuth({
241
241
  onVerifySuccess: () => setIsValidated(true),
242
242
  options: { email: email$1 },
@@ -263,7 +263,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
263
263
  setLoading,
264
264
  verificationUUID,
265
265
  user,
266
- unauthenticatedUser,
266
+ userWithMissingInfo,
267
267
  completeAuth,
268
268
  email$1,
269
269
  isEmailRecoveryFlow,
@@ -307,7 +307,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
307
307
  }, []);
308
308
  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', {
309
309
  'email-verification__container--error': Boolean(error),
310
- }), 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: 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 || unauthenticatedUser) && !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') }))] })] }));
310
+ }), 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: 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: handleLogOut, copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
311
311
  };
312
312
 
313
313
  exports.EmailVerification = EmailVerification;
@@ -110,7 +110,7 @@ import 'qrcode';
110
110
  const SECONDS_TO_RETRY = 15;
111
111
  const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _showRetryButton = true, showTransferMessage: _showTransferMessage = false, }) => {
112
112
  var _a, _b, _c, _d;
113
- const { environmentId, handleLogOut, setPrimaryWalletId, setShowAuthFlow, projectSettings, user, unauthenticatedUser, walletConnectorOptions, walletConnector, } = useInternalDynamicContext();
113
+ const { environmentId, handleLogOut, setPrimaryWalletId, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, walletConnector, } = useInternalDynamicContext();
114
114
  const { setView, goToInitialView } = useViewContext();
115
115
  const { error, setError, setErrorMessage } = useErrorContext();
116
116
  const { loading, setLoading } = useLoadingContext();
@@ -232,7 +232,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
232
232
  if (!verificationUUID) {
233
233
  return cancelAuth();
234
234
  }
235
- if (!user && !unauthenticatedUser) {
235
+ if (!user && !userWithMissingInfo) {
236
236
  return initAuth({
237
237
  onVerifySuccess: () => setIsValidated(true),
238
238
  options: { email },
@@ -259,7 +259,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
259
259
  setLoading,
260
260
  verificationUUID,
261
261
  user,
262
- unauthenticatedUser,
262
+ userWithMissingInfo,
263
263
  completeAuth,
264
264
  email,
265
265
  isEmailRecoveryFlow,
@@ -303,7 +303,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
303
303
  }, []);
304
304
  return (jsxs(Fragment, { children: [error && (jsx(ErrorContainer, { withIcon: false, className: 'email-verification__error-message', children: error })), jsxs("div", { className: classNames('email-verification__container', {
305
305
  'email-verification__container--error': Boolean(error),
306
- }), 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: 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 || unauthenticatedUser) && !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') }))] })] }));
306
+ }), 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: 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: handleLogOut, copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
307
307
  };
308
308
 
309
309
  export { EmailVerification };
@@ -95,7 +95,7 @@ require('../../context/ReinitializeContext/ReinitializeContextProvider.cjs');
95
95
 
96
96
  const MfaVerificationView = ({ type }) => {
97
97
  const { t } = reactI18next.useTranslation();
98
- const { user } = useDynamicContext.useDynamicContext();
98
+ const { userWithMissingInfo } = useDynamicContext.useDynamicContext();
99
99
  const { setView } = ViewContext.useViewContext();
100
100
  const { authDevice } = useMfa.useMfa();
101
101
  const [code, setCode] = React.useState('');
@@ -107,7 +107,7 @@ const MfaVerificationView = ({ type }) => {
107
107
  setError(new utils.DynamicError(t('dyn_mfa.otp_verification_view.error')));
108
108
  },
109
109
  onResolve: () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
110
- if ((user === null || user === void 0 ? void 0 : user.mfaBackupCodeAcknowledgement) !==
110
+ if ((userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.mfaBackupCodeAcknowledgement) !==
111
111
  sdkApiCore.MfaBackupCodeAcknowledgement.Complete) {
112
112
  setView('mfa-display-backup-codes');
113
113
  }
@@ -91,7 +91,7 @@ import '../../context/ReinitializeContext/ReinitializeContextProvider.js';
91
91
 
92
92
  const MfaVerificationView = ({ type }) => {
93
93
  const { t } = useTranslation();
94
- const { user } = useDynamicContext();
94
+ const { userWithMissingInfo } = useDynamicContext();
95
95
  const { setView } = useViewContext();
96
96
  const { authDevice } = useMfa();
97
97
  const [code, setCode] = useState('');
@@ -103,7 +103,7 @@ const MfaVerificationView = ({ type }) => {
103
103
  setError(new DynamicError(t('dyn_mfa.otp_verification_view.error')));
104
104
  },
105
105
  onResolve: () => __awaiter(void 0, void 0, void 0, function* () {
106
- if ((user === null || user === void 0 ? void 0 : user.mfaBackupCodeAcknowledgement) !==
106
+ if ((userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.mfaBackupCodeAcknowledgement) !==
107
107
  MfaBackupCodeAcknowledgement.Complete) {
108
108
  setView('mfa-display-backup-codes');
109
109
  }
@@ -103,7 +103,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
103
103
 
104
104
  const PasskeyIntroView = ({ chains }) => {
105
105
  var _a;
106
- const { walletConnectorOptions, environmentId, handleLogOut, user, unauthenticatedUser, } = useInternalDynamicContext.useInternalDynamicContext();
106
+ const { walletConnectorOptions, environmentId, handleLogOut, user, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
107
107
  const isEmailRecoveryFlow = ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
108
108
  !getUserVerifiedCredentialType.getUserVerifiedCredentialType(user, sdkApiCore.JwtVerifiedCredentialFormatEnum.Email);
109
109
  const { t } = reactI18next.useTranslation();
@@ -116,7 +116,7 @@ const PasskeyIntroView = ({ chains }) => {
116
116
  React.useEffect(() => localStorage.LocalStorage.removeFromLS(localStorage$1.LAST_USED_WALLET), []);
117
117
  const { createDynamicEmbeddedWalletMutation, isLoading, error } = useCreateDynamicEmbeddedWalletMutation.useCreateDynamicEmbeddedWalletMutation();
118
118
  const handleCreateEmbeddedWallet = (withAuthenticator) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
119
- if (!user && !unauthenticatedUser) {
119
+ if (!user && !userWithMissingInfo) {
120
120
  throw new Error('User is not logged in');
121
121
  }
122
122
  setCreateWalletWithAuthenticator(withAuthenticator);
@@ -1,7 +1,7 @@
1
1
  import { FC } from 'react';
2
- import { ChainEnum } from '@dynamic-labs/sdk-api-core';
2
+ import { EmbeddedWalletChainEnum } from '@dynamic-labs/sdk-api-core';
3
3
  type PasskeyIntroViewProps = {
4
- chains?: ChainEnum[];
4
+ chains?: EmbeddedWalletChainEnum[];
5
5
  };
6
6
  export declare const PasskeyIntroView: FC<PasskeyIntroViewProps>;
7
7
  export {};
@@ -99,7 +99,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
99
99
 
100
100
  const PasskeyIntroView = ({ chains }) => {
101
101
  var _a;
102
- const { walletConnectorOptions, environmentId, handleLogOut, user, unauthenticatedUser, } = useInternalDynamicContext();
102
+ const { walletConnectorOptions, environmentId, handleLogOut, user, userWithMissingInfo, } = useInternalDynamicContext();
103
103
  const isEmailRecoveryFlow = ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
104
104
  !getUserVerifiedCredentialType(user, JwtVerifiedCredentialFormatEnum.Email);
105
105
  const { t } = useTranslation();
@@ -112,7 +112,7 @@ const PasskeyIntroView = ({ chains }) => {
112
112
  useEffect(() => LocalStorage.removeFromLS(LAST_USED_WALLET), []);
113
113
  const { createDynamicEmbeddedWalletMutation, isLoading, error } = useCreateDynamicEmbeddedWalletMutation();
114
114
  const handleCreateEmbeddedWallet = (withAuthenticator) => __awaiter(void 0, void 0, void 0, function* () {
115
- if (!user && !unauthenticatedUser) {
115
+ if (!user && !userWithMissingInfo) {
116
116
  throw new Error('User is not logged in');
117
117
  }
118
118
  setCreateWalletWithAuthenticator(withAuthenticator);
@@ -1,11 +1,11 @@
1
- import { ChainEnum } from '@dynamic-labs/sdk-api-core';
1
+ import { EmbeddedWalletChainEnum } from '@dynamic-labs/sdk-api-core';
2
2
  import { UserProfile } from '@dynamic-labs/types';
3
3
  import { IEmailWalletConnector, IPasskeyWalletConnector, WebAuthnAttestation } from '@dynamic-labs/wallet-connector-core';
4
4
  type CreateEmbeddedWalletRequestProps = {
5
5
  environmentId: string;
6
6
  user: UserProfile | undefined;
7
7
  walletConnector: (IPasskeyWalletConnector & IEmailWalletConnector) | undefined;
8
- chains: ChainEnum[];
8
+ chains: EmbeddedWalletChainEnum[];
9
9
  webAuthnAttestation?: WebAuthnAttestation;
10
10
  withAuthenticator: boolean;
11
11
  };
@@ -96,7 +96,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
96
96
 
97
97
  const useSmsVerification = (type) => {
98
98
  const { verificationUUID, displayedDestination: formattedPhone, retryData, } = VerificationContext.useVerification();
99
- const { environmentId, user, unauthenticatedUser } = useInternalDynamicContext.useInternalDynamicContext();
99
+ const { environmentId, user, userWithMissingInfo } = useInternalDynamicContext.useInternalDynamicContext();
100
100
  const [error, setError] = React.useState();
101
101
  const { verifyOtp } = useOtpVerificationRequest.useOtpVerificationRequest();
102
102
  const { initAuth, completeAuth, cancelAuth } = useUserAuth.useUserAuth({
@@ -134,7 +134,7 @@ const useSmsVerification = (type) => {
134
134
  });
135
135
  });
136
136
  const submitOtpForVerification = React.useCallback((verificationToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
137
- if (!verificationUUID || (!user && !unauthenticatedUser)) {
137
+ if (!verificationUUID || (!user && !userWithMissingInfo)) {
138
138
  yield cancelAuth();
139
139
  return;
140
140
  }
@@ -146,7 +146,7 @@ const useSmsVerification = (type) => {
146
146
  cancelAuth,
147
147
  completeAuth,
148
148
  user,
149
- unauthenticatedUser,
149
+ userWithMissingInfo,
150
150
  verificationUUID,
151
151
  verifyOtp,
152
152
  ]);