@frontegg/js 7.105.0-alpha.0 → 7.105.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.
@@ -1902,6 +1902,7 @@ __webpack_require__.r(__webpack_exports__);
1902
1902
  var mockFlagsList = {
1903
1903
  admin_portal_ip_restrictions: 'on',
1904
1904
  admin_portal_domain_restrictions: 'on',
1905
+ 'dashboard-account-security-country-restrictions': 'on',
1905
1906
  'new-mfa-pages': 'on',
1906
1907
  'show-passkeys-new': 'on',
1907
1908
  'groups-admin-box-new': 'on',
@@ -1923,7 +1924,7 @@ __webpack_require__.r(__webpack_exports__);
1923
1924
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1924
1925
  /* harmony export */ });
1925
1926
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1926
- cdnVersion: '7.105.0-alpha.0'
1927
+ cdnVersion: '7.105.0'
1927
1928
  });
1928
1929
 
1929
1930
  /***/ }),
@@ -6096,28 +6097,28 @@ __webpack_require__.r(__webpack_exports__);
6096
6097
  /* harmony import */ var _mfaWithEmailCode_actions__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./mfaWithEmailCode.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/mfaWithEmailCode.actions.js");
6097
6098
  /* harmony import */ var _mfaWithSMS_actions__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./mfaWithSMS.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/mfaWithSMS.actions.js");
6098
6099
  /* harmony import */ var _mfaWithWebAuthn_actions__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./mfaWithWebAuthn.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/mfaWithWebAuthn.actions.js");
6099
- /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../interfaces */ "../../dist/@frontegg/redux-store/auth/LoginState/interfaces.js");
6100
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/common.js");
6101
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/handlers.js");
6102
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
6100
+ /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../interfaces */ "../../dist/@frontegg/redux-store/auth/LoginState/interfaces.js");
6101
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/common.js");
6102
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/handlers.js");
6103
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
6103
6104
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/encoders.js");
6104
6105
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/converters.js");
6105
- /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../state */ "../../dist/@frontegg/redux-store/auth/LoginState/state.js");
6106
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../helpers */ "../../dist/@frontegg/redux-store/auth/LoginState/helpers.js");
6106
+ /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../state */ "../../dist/@frontegg/redux-store/auth/LoginState/state.js");
6107
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../helpers */ "../../dist/@frontegg/redux-store/auth/LoginState/helpers.js");
6107
6108
  /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/ContextHolder/index.js");
6108
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/utils.js");
6109
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/feature-flags/index.js");
6110
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/enums.js");
6109
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/feature-flags/index.js");
6110
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/enums.js");
6111
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/utils.js");
6111
6112
  /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/interfaces.js");
6112
6113
  /* harmony import */ var _hostedLoginAuthorize_actions__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./hostedLoginAuthorize.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/hostedLoginAuthorize.actions.js");
6113
- /* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/auth/Entitlements/helpers.js");
6114
- /* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/toolkit/FronteggNativeModule.js");
6115
- /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../interfaces */ "../../dist/@frontegg/redux-store/auth/interfaces.js");
6114
+ /* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/auth/Entitlements/helpers.js");
6115
+ /* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/toolkit/FronteggNativeModule.js");
6116
+ /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../interfaces */ "../../dist/@frontegg/redux-store/auth/interfaces.js");
6116
6117
  /* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../consts */ "../../dist/@frontegg/redux-store/auth/LoginState/consts.js");
6117
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/helpers.js");
6118
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/helpers.js");
6118
6119
  /* harmony import */ var _MfaState_interfaces__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../MfaState/interfaces */ "../../dist/@frontegg/redux-store/auth/MfaState/interfaces.js");
6119
- /* harmony import */ var _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../SSOState/interfaces */ "../../dist/@frontegg/redux-store/auth/SSOState/interfaces.js");
6120
- /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../constants */ "../../dist/@frontegg/redux-store/constants.js");
6120
+ /* harmony import */ var _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../SSOState/interfaces */ "../../dist/@frontegg/redux-store/auth/SSOState/interfaces.js");
6121
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../constants */ "../../dist/@frontegg/redux-store/constants.js");
6121
6122
 
6122
6123
 
6123
6124
  const _excluded = ["callback", "error"],
@@ -6171,13 +6172,10 @@ const _excluded = ["callback", "error"],
6171
6172
  return;
6172
6173
  }
6173
6174
  try {
6174
- const tabTenantId = (0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.getTabTenantFromSessionStorage)(store.root.appName);
6175
- const body = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({
6175
+ const body = {
6176
6176
  grant_type: 'refresh_token',
6177
6177
  refresh_token: user == null ? void 0 : user.refreshToken
6178
- }, tabTenantId && {
6179
- tenantId: tabTenantId
6180
- });
6178
+ };
6181
6179
  const response = await api.auth.exchangeOAuthTokensV2(body);
6182
6180
  const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
6183
6181
  actions.afterAuthenticationStateUpdate((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, response, {
@@ -6217,7 +6215,7 @@ const _excluded = ["callback", "error"],
6217
6215
  tenants = [],
6218
6216
  activeTenant
6219
6217
  } = await api.auth.refreshTokenV3();
6220
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isMfaRequired)(user, store.root.appName)) {
6218
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isMfaRequired)(user, store.root.appName)) {
6221
6219
  const mfaRequiredState = await actions.getMfaRequiredState(user);
6222
6220
  actions.setAuthState(mfaRequiredState);
6223
6221
  onRedirectTo(routes.loginUrl, {
@@ -6238,7 +6236,7 @@ const _excluded = ["callback", "error"],
6238
6236
  }, {
6239
6237
  loginState: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, loginState, {
6240
6238
  quickLoginToRegister,
6241
- flow: shouldNavigateToRegisterQuickLogin ? _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.RegisterQuickLogin : _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.Login
6239
+ flow: shouldNavigateToRegisterQuickLogin ? _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.RegisterQuickLogin : _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.Login
6242
6240
  }),
6243
6241
  isAuthenticated: true
6244
6242
  });
@@ -6279,7 +6277,7 @@ const _excluded = ["callback", "error"],
6279
6277
  var _store$auth$user;
6280
6278
  // @ts-ignore TODO: fix entitlements state type
6281
6279
  const oldEntitlements = (_store$auth$user = store.auth.user) == null ? void 0 : _store$auth$user.entitlements;
6282
- if ((0,_toolkit__WEBPACK_IMPORTED_MODULE_6__.isEntitlementsDeeplyEqual)(oldEntitlements, updatedUser == null ? void 0 : updatedUser.entitlements)) {
6280
+ if ((0,_toolkit__WEBPACK_IMPORTED_MODULE_5__.isEntitlementsDeeplyEqual)(oldEntitlements, updatedUser == null ? void 0 : updatedUser.entitlements)) {
6283
6281
  // set the previous entitlements object
6284
6282
  return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, updatedUser, {
6285
6283
  entitlements: oldEntitlements
@@ -6299,7 +6297,7 @@ const _excluded = ["callback", "error"],
6299
6297
  loginState,
6300
6298
  onRedirectTo
6301
6299
  } = store.auth;
6302
- const [preventAuthRedirectOnSocialLogin] = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_7__.FeatureFlags.getFeatureFlags(['prevent-auth-redirect-on-social-login'], store.root.appName);
6300
+ const [preventAuthRedirectOnSocialLogin] = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_6__.FeatureFlags.getFeatureFlags(['prevent-auth-redirect-on-social-login'], store.root.appName);
6303
6301
  const invitationToken = url.searchParams.get('invitationToken');
6304
6302
  const redirectRoutes = [routes.socialLoginCallbackUrl, routes.oidcRedirectUrl, routes.samlCallbackUrl, routes.magicLinkCallbackUrl];
6305
6303
  if (!invitationToken) {
@@ -6328,7 +6326,7 @@ const _excluded = ["callback", "error"],
6328
6326
  var _payload$callback;
6329
6327
  const {
6330
6328
  isActive
6331
- } = await (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.retryIfNeeded)(api.auth.getSSOPublicConfiguration, payload == null ? void 0 : payload.retryConfig);
6329
+ } = await (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.retryIfNeeded)(api.auth.getSSOPublicConfiguration, payload == null ? void 0 : payload.retryConfig);
6332
6330
  actions.setAuthState({
6333
6331
  isSSOAuth: isActive
6334
6332
  });
@@ -6347,7 +6345,7 @@ const _excluded = ["callback", "error"],
6347
6345
  let ssoACS;
6348
6346
  try {
6349
6347
  var _metadata$configurati;
6350
- const metadata = await (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.retryIfNeeded)(api.metadata.getSamlMetadata, payload == null ? void 0 : payload.retryConfig);
6348
+ const metadata = await (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.retryIfNeeded)(api.metadata.getSamlMetadata, payload == null ? void 0 : payload.retryConfig);
6351
6349
  ssoACS = metadata == null ? void 0 : (_metadata$configurati = metadata.configuration) == null ? void 0 : _metadata$configurati.acsUrl;
6352
6350
  } catch (e) {
6353
6351
  console.error(e);
@@ -6373,8 +6371,8 @@ const _excluded = ["callback", "error"],
6373
6371
  onRedirectTo,
6374
6372
  routes
6375
6373
  } = store.auth;
6376
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isMfaRequired)(user, store.root.appName)) {
6377
- const mfaRequiredState = await actions.getMfaRequiredState(user, _constants__WEBPACK_IMPORTED_MODULE_9__.DEFAULT_RETRY_CONFIG, true);
6374
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isMfaRequired)(user, store.root.appName)) {
6375
+ const mfaRequiredState = await actions.getMfaRequiredState(user, _constants__WEBPACK_IMPORTED_MODULE_8__.DEFAULT_RETRY_CONFIG, true);
6378
6376
  actions.setAuthState(mfaRequiredState);
6379
6377
  onRedirectTo(routes.loginUrl, {
6380
6378
  preserveQueryParams: true
@@ -6385,17 +6383,17 @@ const _excluded = ["callback", "error"],
6385
6383
  Object.assign(store.auth.loginState, state);
6386
6384
  };
6387
6385
  const resetLoginState = () => {
6388
- (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.deepResetState)(store, ['auth', 'loginState'], _state__WEBPACK_IMPORTED_MODULE_10__.initialState);
6386
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.deepResetState)(store, ['auth', 'loginState'], _state__WEBPACK_IMPORTED_MODULE_9__.initialState);
6389
6387
  };
6390
6388
  const getRetryWithBlockingCallbackPayload = requestName => {
6391
6389
  const callback = (_, error) => {
6392
6390
  if (!error || error.statusCode < 500) return;
6393
6391
  actions.setErrorByRequestName({
6394
6392
  requestName,
6395
- traceId: (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.errorTraceId)(error)
6393
+ traceId: (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.errorTraceId)(error)
6396
6394
  });
6397
6395
  };
6398
- return (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.withRetryConfig)({
6396
+ return (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.withRetryConfig)({
6399
6397
  callback
6400
6398
  });
6401
6399
  };
@@ -6407,19 +6405,19 @@ const _excluded = ["callback", "error"],
6407
6405
  actions.setAuthState({
6408
6406
  isLoading: true
6409
6407
  });
6410
- calls.push(actions.loadSocialLoginsConfigurationV2((0,_helpers__WEBPACK_IMPORTED_MODULE_8__.withRetryConfig)()));
6411
- calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
6412
- calls.push(actions.loadPublicAuthStrategiesPolicy(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_PUBLIC_AUTH_STRATEGIES_POLICY)));
6408
+ calls.push(actions.loadSocialLoginsConfigurationV2((0,_helpers__WEBPACK_IMPORTED_MODULE_7__.withRetryConfig)()));
6409
+ calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
6410
+ calls.push(actions.loadPublicAuthStrategiesPolicy(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_PUBLIC_AUTH_STRATEGIES_POLICY)));
6413
6411
  calls.push(actions.loadSignUpStrategies());
6414
- calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
6415
- calls.push(actions.loadVendorPublicInfo((0,_helpers__WEBPACK_IMPORTED_MODULE_8__.withRetryConfig)()));
6416
- calls.push(__refreshMetadata((0,_helpers__WEBPACK_IMPORTED_MODULE_8__.withRetryConfig)()));
6412
+ calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
6413
+ calls.push(actions.loadVendorPublicInfo((0,_helpers__WEBPACK_IMPORTED_MODULE_7__.withRetryConfig)()));
6414
+ calls.push(__refreshMetadata((0,_helpers__WEBPACK_IMPORTED_MODULE_7__.withRetryConfig)()));
6417
6415
  /*
6418
6416
  We will load custom login routes only if custom login is enabled
6419
6417
  to check if custom login is enabled without the tenant alias (search-param/subdomain)
6420
6418
  we have to wait for the user state (refreshToken request)
6421
6419
  */
6422
- callsAfterRefresh.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
6420
+ callsAfterRefresh.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
6423
6421
  }
6424
6422
  await Promise.all(calls);
6425
6423
  if (callsAfterRefresh.length > 0) {
@@ -6431,14 +6429,14 @@ const _excluded = ["callback", "error"],
6431
6429
  };
6432
6430
  const requestAuthorizeSSR = async payload => {
6433
6431
  const calls = [];
6434
- calls.push(actions.loadSocialLoginsConfigurationV2((0,_helpers__WEBPACK_IMPORTED_MODULE_8__.withRetryConfig)()));
6435
- calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
6436
- calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
6432
+ calls.push(actions.loadSocialLoginsConfigurationV2((0,_helpers__WEBPACK_IMPORTED_MODULE_7__.withRetryConfig)()));
6433
+ calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
6434
+ calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
6437
6435
  calls.push(actions.loadSignUpStrategies());
6438
- calls.push(actions.loadVendorPublicInfo((0,_helpers__WEBPACK_IMPORTED_MODULE_8__.withRetryConfig)()));
6436
+ calls.push(actions.loadVendorPublicInfo((0,_helpers__WEBPACK_IMPORTED_MODULE_7__.withRetryConfig)()));
6439
6437
  calls.push(__refreshMetadata());
6440
6438
  calls.push(__isMFARequiredSSR(payload));
6441
- calls.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
6439
+ calls.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
6442
6440
  await Promise.all(calls);
6443
6441
  };
6444
6442
  const ssoPreloginFailed = async _ref3 => {
@@ -6450,28 +6448,28 @@ const _excluded = ["callback", "error"],
6450
6448
  const publicPolicy = store.auth.securityPolicyState.publicPolicy.policy;
6451
6449
  if (!(publicPolicy != null && publicPolicy.authStrategy)) {
6452
6450
  actions.setLoginState({
6453
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.loginWithPassword,
6451
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.loginWithPassword,
6454
6452
  loading: false
6455
6453
  });
6456
6454
  callback == null ? void 0 : callback();
6457
6455
  return;
6458
6456
  }
6459
- if ((publicPolicy == null ? void 0 : publicPolicy.authStrategy) === _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.AuthStrategyEnum.EmailAndPassword) {
6457
+ if ((publicPolicy == null ? void 0 : publicPolicy.authStrategy) === _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.AuthStrategyEnum.EmailAndPassword) {
6460
6458
  actions.setLoginState({
6461
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.loginWithPassword,
6459
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.loginWithPassword,
6462
6460
  loading: false
6463
6461
  });
6464
6462
  callback == null ? void 0 : callback();
6465
- } else if ([_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.AuthStrategyEnum.MagicLink, _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.AuthStrategyEnum.Code, _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.AuthStrategyEnum.SmsCode].includes(publicPolicy == null ? void 0 : publicPolicy.authStrategy)) {
6463
+ } else if ([_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.AuthStrategyEnum.MagicLink, _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.AuthStrategyEnum.Code, _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.AuthStrategyEnum.SmsCode].includes(publicPolicy == null ? void 0 : publicPolicy.authStrategy)) {
6466
6464
  await actions.passwordlessPreLogin((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, body, {
6467
6465
  type: publicPolicy == null ? void 0 : publicPolicy.authStrategy,
6468
6466
  callback
6469
6467
  }));
6470
6468
  } else {
6471
6469
  actions.setLoginState({
6472
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.loginWithPassword,
6470
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.loginWithPassword,
6473
6471
  loading: false,
6474
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(error)
6472
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(error)
6475
6473
  });
6476
6474
  callback == null ? void 0 : callback();
6477
6475
  }
@@ -6489,7 +6487,7 @@ const _excluded = ["callback", "error"],
6489
6487
  });
6490
6488
  try {
6491
6489
  const onRedirectTo = store.auth.onRedirectTo;
6492
- const tenantId = (0,_helpers__WEBPACK_IMPORTED_MODULE_14__.getSearchParam)(_helpers__WEBPACK_IMPORTED_MODULE_14__.TENANT_ID_PARAM_KEY);
6490
+ const tenantId = (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.getSearchParam)(_helpers__WEBPACK_IMPORTED_MODULE_13__.TENANT_ID_PARAM_KEY);
6493
6491
  const preLoginResult = await api.auth.preLoginV2((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, email ? {
6494
6492
  email
6495
6493
  } : {}, username ? {
@@ -6503,22 +6501,22 @@ const _excluded = ["callback", "error"],
6503
6501
  } = preLoginResult != null ? preLoginResult : {};
6504
6502
  if (address) {
6505
6503
  let ssoRedirectUrl = address;
6506
- if (idpType === _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_15__.SamlVendors.Oidc && !ssoRedirectUrl.includes('redirect_uri')) {
6504
+ if (idpType === _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_14__.SamlVendors.Oidc && !ssoRedirectUrl.includes('redirect_uri')) {
6507
6505
  const {
6508
6506
  oidcRedirectUrl
6509
6507
  } = store.auth.routes;
6510
6508
  ssoRedirectUrl += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
6511
6509
  }
6512
- if (_toolkit__WEBPACK_IMPORTED_MODULE_16__["default"].isLoginWithSSOAvailable()) {
6510
+ if (_toolkit__WEBPACK_IMPORTED_MODULE_15__["default"].isLoginWithSSOAvailable()) {
6513
6511
  var _ref4;
6514
- _toolkit__WEBPACK_IMPORTED_MODULE_16__["default"].loginWithSSO((_ref4 = email != null ? email : username) != null ? _ref4 : '');
6512
+ _toolkit__WEBPACK_IMPORTED_MODULE_15__["default"].loginWithSSO((_ref4 = email != null ? email : username) != null ? _ref4 : '');
6515
6513
  setLoginState({
6516
6514
  loading: false
6517
6515
  });
6518
6516
  callback == null ? void 0 : callback();
6519
6517
  } else {
6520
6518
  setLoginState({
6521
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.redirectToSSO,
6519
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.redirectToSSO,
6522
6520
  loading: false,
6523
6521
  ssoRedirectUrl
6524
6522
  });
@@ -6573,7 +6571,7 @@ const _excluded = ["callback", "error"],
6573
6571
  email: user.email,
6574
6572
  name: user.name
6575
6573
  };
6576
- (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_17__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
6574
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
6577
6575
  }
6578
6576
  await actions.afterAuthNavigation();
6579
6577
  } catch (e) {
@@ -6581,7 +6579,7 @@ const _excluded = ["callback", "error"],
6581
6579
  onRedirectTo(routes.authenticatedUrl);
6582
6580
  }, 1000);
6583
6581
  setLoginState({
6584
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.loginWithSSOFailed,
6582
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.loginWithSSOFailed,
6585
6583
  loading: false
6586
6584
  });
6587
6585
  }
@@ -6616,17 +6614,17 @@ const _excluded = ["callback", "error"],
6616
6614
  onRedirectTo,
6617
6615
  routes
6618
6616
  } = store.auth;
6619
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isMfaRequired)(user, store.root.appName)) {
6620
- const mfaRequiredState = await actions.getMfaRequiredState(user, _constants__WEBPACK_IMPORTED_MODULE_9__.DEFAULT_RETRY_CONFIG, true, email);
6617
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isMfaRequired)(user, store.root.appName)) {
6618
+ const mfaRequiredState = await actions.getMfaRequiredState(user, _constants__WEBPACK_IMPORTED_MODULE_8__.DEFAULT_RETRY_CONFIG, true, email);
6621
6619
  actions.setAuthState(mfaRequiredState);
6622
6620
  onRedirectTo(routes.loginUrl, {
6623
6621
  preserveQueryParams: true
6624
6622
  });
6625
6623
  } else {
6626
6624
  const [securityCenterLoginFlows] = await actions.getFeatureFlags(['security-center-show-login-flows']);
6627
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isResetPasswordRequired)(user, store.root.appName)) {
6625
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isResetPasswordRequired)(user, store.root.appName)) {
6628
6626
  setLoginState({
6629
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.passwordRotationExpired,
6627
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.passwordRotationExpired,
6630
6628
  loading: false,
6631
6629
  resetPasswordToken: user.resetPasswordToken,
6632
6630
  userId: user.userId
@@ -6649,7 +6647,7 @@ const _excluded = ["callback", "error"],
6649
6647
  loading: false,
6650
6648
  error: undefined,
6651
6649
  mfaToken: user.mfaToken,
6652
- step: loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.Login ? _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.success : loginState.step,
6650
+ step: loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.Login ? _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.success : loginState.step,
6653
6651
  tenants,
6654
6652
  tenantsLoading: true,
6655
6653
  isBreachedPassword: user.isBreachedPassword
@@ -6666,27 +6664,27 @@ const _excluded = ["callback", "error"],
6666
6664
  email,
6667
6665
  name: user.name
6668
6666
  };
6669
- (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_17__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
6667
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
6670
6668
  }
6671
- if (loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.Login) {
6669
+ if (loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.Login) {
6672
6670
  if (securityCenterLoginFlows && user.isBreachedPassword && !isAuthenticated) {
6673
6671
  setLoginState({
6674
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.breachedPassword,
6672
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.breachedPassword,
6675
6673
  loading: false
6676
6674
  });
6677
6675
  } else {
6678
6676
  if (isAuthenticated) {
6679
- const shouldShowPasswordRotationPrompt = (0,_helpers__WEBPACK_IMPORTED_MODULE_14__.shouldShowPasswordRotationPromptFunc)(user);
6677
+ const shouldShowPasswordRotationPrompt = (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.shouldShowPasswordRotationPromptFunc)(user);
6680
6678
  if (shouldShowPasswordRotationPrompt) {
6681
6679
  setLoginState({
6682
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.passwordRotationNotification,
6680
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.passwordRotationNotification,
6683
6681
  loading: false
6684
6682
  });
6685
6683
  } else {
6686
6684
  const shouldShowPromptPasskeys = await actions.__shouldShowPromptPasskeys();
6687
6685
  if (shouldShowPromptPasskeys) {
6688
6686
  setLoginState({
6689
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.promptPasskeys,
6687
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.promptPasskeys,
6690
6688
  loading: false
6691
6689
  });
6692
6690
  onRedirectTo(routes.loginUrl, {
@@ -6701,8 +6699,8 @@ const _excluded = ["callback", "error"],
6701
6699
  }
6702
6700
  }
6703
6701
  }
6704
- if (_toolkit__WEBPACK_IMPORTED_MODULE_16__["default"].isSuggestSavePasswordAvailable()) {
6705
- _toolkit__WEBPACK_IMPORTED_MODULE_16__["default"].suggestSavePassword(email, password);
6702
+ if (_toolkit__WEBPACK_IMPORTED_MODULE_15__["default"].isSuggestSavePasswordAvailable()) {
6703
+ _toolkit__WEBPACK_IMPORTED_MODULE_15__["default"].suggestSavePassword(email, password);
6706
6704
  }
6707
6705
 
6708
6706
  // TODO: extract item name to constants
@@ -6714,7 +6712,7 @@ const _excluded = ["callback", "error"],
6714
6712
  callback == null ? void 0 : callback(false, e);
6715
6713
  setLoginState({
6716
6714
  email,
6717
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e),
6715
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e),
6718
6716
  loading: false
6719
6717
  });
6720
6718
  }
@@ -6734,7 +6732,7 @@ const _excluded = ["callback", "error"],
6734
6732
  /* empty */
6735
6733
  }
6736
6734
  if (contextHolder.isSessionPerTenantEnabled()) {
6737
- (0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.removeTabTenantFromSessionStorage)();
6735
+ (0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__.removeTabTenantFromSessionStorage)();
6738
6736
  }
6739
6737
  actions.resetAuthState();
6740
6738
  await actions.requestAuthorize(true);
@@ -6748,7 +6746,7 @@ const _excluded = ["callback", "error"],
6748
6746
  /* empty */
6749
6747
  }
6750
6748
  if (contextHolder.isSessionPerTenantEnabled()) {
6751
- (0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.removeTabTenantFromSessionStorage)();
6749
+ (0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__.removeTabTenantFromSessionStorage)();
6752
6750
  }
6753
6751
  setTimeout(() => {
6754
6752
  var _payload$callback3;
@@ -6765,7 +6763,7 @@ const _excluded = ["callback", "error"],
6765
6763
  setLoginState({
6766
6764
  loading: false,
6767
6765
  error: undefined,
6768
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.preLogin
6766
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.preLogin
6769
6767
  });
6770
6768
  actions.setAuthState({
6771
6769
  user: undefined,
@@ -6775,7 +6773,7 @@ const _excluded = ["callback", "error"],
6775
6773
  } catch (e) {
6776
6774
  var _payload$callback5;
6777
6775
  setLoginState({
6778
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e),
6776
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e),
6779
6777
  loading: false
6780
6778
  });
6781
6779
  (_payload$callback5 = payload.callback) == null ? void 0 : _payload$callback5.call(payload, false, e);
@@ -6794,10 +6792,10 @@ const _excluded = ["callback", "error"],
6794
6792
  // TODO: fix @frontegg/rest-api return value
6795
6793
  // @ts-ignore
6796
6794
  const preloginRes = await api.auth.passwordlessPreLogin((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, payload, {
6797
- type: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.AuthStrategyEnum.SmsCode
6795
+ type: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.AuthStrategyEnum.SmsCode
6798
6796
  }));
6799
6797
  setLoginState({
6800
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.loginWithQuickSmsOtc,
6798
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.loginWithQuickSmsOtc,
6801
6799
  loading: false,
6802
6800
  phoneNumber: preloginRes == null ? void 0 : preloginRes.phoneNumber,
6803
6801
  error: undefined
@@ -6805,7 +6803,7 @@ const _excluded = ["callback", "error"],
6805
6803
  callback == null ? void 0 : callback(true);
6806
6804
  } catch (e) {
6807
6805
  setLoginState({
6808
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e),
6806
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e),
6809
6807
  loading: false
6810
6808
  });
6811
6809
  callback == null ? void 0 : callback(false, e);
@@ -6825,13 +6823,13 @@ const _excluded = ["callback", "error"],
6825
6823
  phoneNumber: payload.phoneNumber,
6826
6824
  loading: false,
6827
6825
  changePhoneId: changePhoneRes.changePhoneId,
6828
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.loginWithQuickSmsOtc,
6826
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.loginWithQuickSmsOtc,
6829
6827
  error: undefined
6830
6828
  });
6831
6829
  callback == null ? void 0 : callback(true);
6832
6830
  } catch (e) {
6833
6831
  setLoginState({
6834
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e),
6832
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e),
6835
6833
  loading: false
6836
6834
  });
6837
6835
  }
@@ -6852,7 +6850,7 @@ const _excluded = ["callback", "error"],
6852
6850
  callback == null ? void 0 : callback(true);
6853
6851
  } catch (e) {
6854
6852
  setLoginState({
6855
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e),
6853
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e),
6856
6854
  loading: false
6857
6855
  });
6858
6856
  }
@@ -6868,11 +6866,11 @@ const _excluded = ["callback", "error"],
6868
6866
  loading: true
6869
6867
  });
6870
6868
  let email;
6871
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_14__.isEmailPayload)(payload)) {
6869
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_13__.isEmailPayload)(payload)) {
6872
6870
  email = payload.email;
6873
6871
  }
6874
6872
  let username;
6875
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_14__.isUsernamePayload)(payload)) {
6873
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_13__.isUsernamePayload)(payload)) {
6876
6874
  username = payload.username;
6877
6875
  }
6878
6876
  // TODO: [Typescript 4.8] fix @frontegg/rest-api return value
@@ -6894,7 +6892,7 @@ const _excluded = ["callback", "error"],
6894
6892
  callback == null ? void 0 : callback();
6895
6893
  } catch (e) {
6896
6894
  setLoginState({
6897
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e),
6895
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e),
6898
6896
  loading: false
6899
6897
  });
6900
6898
  callback == null ? void 0 : callback(null, e);
@@ -6919,7 +6917,7 @@ const _excluded = ["callback", "error"],
6919
6917
  routes,
6920
6918
  onRedirectTo
6921
6919
  } = store.auth;
6922
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isMfaRequired)(user, store.root.appName)) {
6920
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isMfaRequired)(user, store.root.appName)) {
6923
6921
  const mfaRequiredState = await actions.getMfaRequiredState(user);
6924
6922
  actions.setAuthState(mfaRequiredState);
6925
6923
  onRedirectTo(routes.loginUrl, {
@@ -6932,14 +6930,14 @@ const _excluded = ["callback", "error"],
6932
6930
  var _events$userVerified;
6933
6931
  const userVerifiedPayload = {
6934
6932
  email: user.email,
6935
- origin: _interfaces__WEBPACK_IMPORTED_MODULE_11__.UserVerifiedOriginTypes.PASSWORDLESS,
6933
+ origin: _interfaces__WEBPACK_IMPORTED_MODULE_10__.UserVerifiedOriginTypes.PASSWORDLESS,
6936
6934
  id: user.id,
6937
6935
  tenantId: user.tenantId,
6938
6936
  createdAt: new Date(),
6939
6937
  name: user.name
6940
6938
  };
6941
6939
  events == null ? void 0 : (_events$userVerified = events.userVerified) == null ? void 0 : _events$userVerified.call(events, userVerifiedPayload);
6942
- (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_17__.GTMEventAction.USER_VERIFIED, userVerifiedPayload);
6940
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.USER_VERIFIED, userVerifiedPayload);
6943
6941
  }
6944
6942
  const loginCompletedPayload = {
6945
6943
  tenantId: user.tenantId,
@@ -6949,7 +6947,7 @@ const _excluded = ["callback", "error"],
6949
6947
  email: user.email,
6950
6948
  name: user.name
6951
6949
  };
6952
- (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_17__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
6950
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
6953
6951
  if (user.id) {
6954
6952
  localStorage.setItem('userId', user.id);
6955
6953
  }
@@ -6964,11 +6962,11 @@ const _excluded = ["callback", "error"],
6964
6962
  actions.setAuthState({
6965
6963
  isLoading: false
6966
6964
  });
6967
- if (loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.Login) {
6965
+ if (loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.Login) {
6968
6966
  const shouldShowPrompt = await actions.__shouldShowPromptPasskeys();
6969
6967
  if (shouldShowPrompt) {
6970
6968
  actions.setLoginState({
6971
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.promptPasskeys,
6969
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.promptPasskeys,
6972
6970
  loading: false
6973
6971
  });
6974
6972
  onRedirectTo(routes.loginUrl, {
@@ -6978,12 +6976,12 @@ const _excluded = ["callback", "error"],
6978
6976
  actions.setAuthState({
6979
6977
  isAuthenticated: true
6980
6978
  });
6981
- if (_payload.type === _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.AuthStrategyEnum.MagicLink) {
6979
+ if (_payload.type === _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.AuthStrategyEnum.MagicLink) {
6982
6980
  actions.setLoginState({
6983
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.magicLinkPostLoginSuccess,
6981
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.magicLinkPostLoginSuccess,
6984
6982
  loading: false
6985
6983
  });
6986
- await (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.delay)(5000);
6984
+ await (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.delay)(5000);
6987
6985
  }
6988
6986
  await actions.afterAuthNavigation();
6989
6987
  }
@@ -6997,7 +6995,7 @@ const _excluded = ["callback", "error"],
6997
6995
  }
6998
6996
  } catch (e) {
6999
6997
  setLoginState({
7000
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e, 'Failed to authenticate')
6998
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e, 'Failed to authenticate')
7001
6999
  });
7002
7000
  callback == null ? void 0 : callback(null, e);
7003
7001
  } finally {
@@ -7021,7 +7019,7 @@ const _excluded = ["callback", "error"],
7021
7019
  });
7022
7020
  } catch (e) {
7023
7021
  setLoginState({
7024
- inviteTokenError: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e, `We couldn't verify your invitation`)
7022
+ inviteTokenError: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e, `We couldn't verify your invitation`)
7025
7023
  });
7026
7024
  } finally {
7027
7025
  setLoginState({
@@ -7057,7 +7055,7 @@ const _excluded = ["callback", "error"],
7057
7055
  callback == null ? void 0 : callback(options);
7058
7056
  } catch (e) {
7059
7057
  setLoginState({
7060
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7058
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7061
7059
  });
7062
7060
  callback == null ? void 0 : callback(null);
7063
7061
  } finally {
@@ -7094,7 +7092,7 @@ const _excluded = ["callback", "error"],
7094
7092
  user
7095
7093
  } = _await$api$auth$webAu,
7096
7094
  rest = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_await$api$auth$webAu, _excluded9);
7097
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isMfaRequired)(user, store.root.appName)) {
7095
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isMfaRequired)(user, store.root.appName)) {
7098
7096
  const {
7099
7097
  routes,
7100
7098
  onRedirectTo
@@ -7125,7 +7123,7 @@ const _excluded = ["callback", "error"],
7125
7123
  email: user.email,
7126
7124
  name: user.name
7127
7125
  };
7128
- (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_17__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
7126
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
7129
7127
  await actions.afterAuthNavigation();
7130
7128
  // TODO: Itamar why moving callback to inside the else block
7131
7129
  callback == null ? void 0 : callback(true);
@@ -7133,7 +7131,7 @@ const _excluded = ["callback", "error"],
7133
7131
  // callback?.(true);
7134
7132
  } catch (e) {
7135
7133
  setLoginState({
7136
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7134
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7137
7135
  });
7138
7136
  callback == null ? void 0 : callback(null);
7139
7137
  } finally {
@@ -7164,7 +7162,7 @@ const _excluded = ["callback", "error"],
7164
7162
  callback == null ? void 0 : callback(options);
7165
7163
  } catch (e) {
7166
7164
  setLoginState({
7167
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7165
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7168
7166
  });
7169
7167
  callback == null ? void 0 : callback(null);
7170
7168
  } finally {
@@ -7192,7 +7190,7 @@ const _excluded = ["callback", "error"],
7192
7190
  callback == null ? void 0 : callback(true);
7193
7191
  } catch (e) {
7194
7192
  setLoginState({
7195
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7193
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7196
7194
  });
7197
7195
  callback == null ? void 0 : callback(null);
7198
7196
  } finally {
@@ -7268,7 +7266,7 @@ const _excluded = ["callback", "error"],
7268
7266
  } catch (e) {
7269
7267
  setLoginState({
7270
7268
  loading: false,
7271
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7269
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7272
7270
  });
7273
7271
  callback == null ? void 0 : callback(null);
7274
7272
  }
@@ -7294,7 +7292,7 @@ const _excluded = ["callback", "error"],
7294
7292
  } catch (e) {
7295
7293
  setLoginState({
7296
7294
  loading: false,
7297
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7295
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7298
7296
  });
7299
7297
  callback == null ? void 0 : callback(null);
7300
7298
  }
@@ -7317,7 +7315,7 @@ const _excluded = ["callback", "error"],
7317
7315
  } catch (e) {
7318
7316
  setLoginState({
7319
7317
  loading: false,
7320
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7318
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7321
7319
  });
7322
7320
  callback == null ? void 0 : callback(null);
7323
7321
  }
@@ -7344,7 +7342,7 @@ const _excluded = ["callback", "error"],
7344
7342
  } catch (e) {
7345
7343
  setLoginState({
7346
7344
  loading: false,
7347
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7345
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7348
7346
  });
7349
7347
  callback == null ? void 0 : callback(null);
7350
7348
  }
@@ -7367,7 +7365,7 @@ const _excluded = ["callback", "error"],
7367
7365
  } catch (e) {
7368
7366
  setLoginState({
7369
7367
  loading: false,
7370
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7368
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7371
7369
  });
7372
7370
  callback == null ? void 0 : callback(null);
7373
7371
  }
@@ -7407,7 +7405,7 @@ const _excluded = ["callback", "error"],
7407
7405
  setLoginState({
7408
7406
  loading: false,
7409
7407
  error: undefined,
7410
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.breachedPasswordSuccess
7408
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.breachedPasswordSuccess
7411
7409
  });
7412
7410
  actions.setAuthState({
7413
7411
  isAuthenticated: false
@@ -7415,7 +7413,7 @@ const _excluded = ["callback", "error"],
7415
7413
  } catch (e) {
7416
7414
  setLoginState({
7417
7415
  loading: false,
7418
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7416
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7419
7417
  });
7420
7418
  }
7421
7419
  };
@@ -7435,13 +7433,10 @@ const _excluded = ["callback", "error"],
7435
7433
  return;
7436
7434
  }
7437
7435
  try {
7438
- const tabTenantId = (0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.getTabTenantFromSessionStorage)(store.root.appName);
7439
- const body = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({
7436
+ const body = {
7440
7437
  grant_type: 'refresh_token',
7441
7438
  refresh_token: currentUser == null ? void 0 : currentUser.refreshToken
7442
- }, tabTenantId && {
7443
- tenantId: tabTenantId
7444
- });
7439
+ };
7445
7440
  const response = await api.auth.exchangeOAuthTokensV2(body);
7446
7441
  const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
7447
7442
  actions.afterAuthenticationStateUpdate((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, response, {
@@ -7471,7 +7466,7 @@ const _excluded = ["callback", "error"],
7471
7466
  tenants = [],
7472
7467
  activeTenant
7473
7468
  } = await api.auth.refreshTokenV3();
7474
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isMfaRequired)(user, store.root.appName)) {
7469
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isMfaRequired)(user, store.root.appName)) {
7475
7470
  const mfaRequiredState = await actions.getMfaRequiredState(user);
7476
7471
  actions.setAuthState(mfaRequiredState);
7477
7472
  onRedirectTo(routes.loginUrl, {
@@ -7482,7 +7477,7 @@ const _excluded = ["callback", "error"],
7482
7477
  const shouldShowPrompt = await actions.__shouldShowPromptPasskeys();
7483
7478
  if (shouldShowPrompt) {
7484
7479
  actions.setLoginState({
7485
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.promptPasskeys,
7480
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.promptPasskeys,
7486
7481
  loading: false
7487
7482
  });
7488
7483
  actions.afterAuthenticationStateUpdate({
@@ -7509,7 +7504,7 @@ const _excluded = ["callback", "error"],
7509
7504
  }, {
7510
7505
  loginState: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, loginState, {
7511
7506
  quickLoginToRegister,
7512
- flow: shouldNavigateToRegisterQuickLogin ? _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.RegisterQuickLogin : _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.Login
7507
+ flow: shouldNavigateToRegisterQuickLogin ? _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.RegisterQuickLogin : _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.Login
7513
7508
  }),
7514
7509
  isAuthenticated: true
7515
7510
  });
@@ -12594,7 +12589,8 @@ __webpack_require__.r(__webpack_exports__);
12594
12589
  const _excluded = ["callback"],
12595
12590
  _excluded2 = ["callback"],
12596
12591
  _excluded3 = ["callback"],
12597
- _excluded4 = ["callback"];
12592
+ _excluded4 = ["callback"],
12593
+ _excluded5 = ["callback"];
12598
12594
 
12599
12595
 
12600
12596
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((store, api, sharedActions) => {
@@ -12624,12 +12620,9 @@ const _excluded = ["callback"],
12624
12620
  */
12625
12621
  const __securityCenterSagaWrapper = action => {
12626
12622
  return async (...args) => {
12627
- const [securityCenterFeatureFlag] = await actions.getFeatureFlags(['security-center-admin-portal-major-version']);
12628
12623
  await action(...args);
12629
- if (securityCenterFeatureFlag) {
12630
- await actions.loadRecommendations((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.withRetryConfig)());
12631
- await actions.loadInsights((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.withRetryConfig)());
12632
- }
12624
+ await actions.loadRecommendations((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.withRetryConfig)());
12625
+ await actions.loadInsights((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.withRetryConfig)());
12633
12626
  };
12634
12627
  };
12635
12628
  const setRestrictionsState = state => {
@@ -12641,6 +12634,9 @@ const _excluded = ["callback"],
12641
12634
  const setEmailDomainRestrictionsState = state => {
12642
12635
  Object.assign(store.auth.restrictionsState.emailDomainRestrictions, state);
12643
12636
  };
12637
+ const setCountryRestrictionsState = state => {
12638
+ Object.assign(store.auth.restrictionsState.countryRestrictions, state);
12639
+ };
12644
12640
  const loadIpRestrictions = async () => {
12645
12641
  setIpRestrictionsState({
12646
12642
  loading: true,
@@ -13004,6 +13000,97 @@ const _excluded = ["callback"],
13004
13000
  });
13005
13001
  }
13006
13002
  };
13003
+ const loadCountryRestrictions = async () => {
13004
+ setCountryRestrictionsState({
13005
+ loading: true,
13006
+ error: null
13007
+ });
13008
+ try {
13009
+ const [config, restrictions] = await Promise.all([api.auth.getCountryRestrictionsConfig(), api.auth.getCountryRestrictions()]);
13010
+ setCountryRestrictionsState({
13011
+ data: {
13012
+ config,
13013
+ restrictions
13014
+ },
13015
+ loading: false
13016
+ });
13017
+ } catch (e) {
13018
+ setCountryRestrictionsState({
13019
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_4__.errorHandler)(e),
13020
+ loading: false
13021
+ });
13022
+ }
13023
+ };
13024
+ const saveCountryRestrictionsConfig = async payload => {
13025
+ var _countryRestrictionsS, _countryRestrictionsS2;
13026
+ const {
13027
+ callback
13028
+ } = payload,
13029
+ configOverrides = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(payload, _excluded5);
13030
+ const countryRestrictionsState = store.auth.restrictionsState.countryRestrictions;
13031
+ const currentConfig = (_countryRestrictionsS = (_countryRestrictionsS2 = countryRestrictionsState.data) == null ? void 0 : _countryRestrictionsS2.config) != null ? _countryRestrictionsS : {
13032
+ enabled: false,
13033
+ action: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_2__.RestrictionType.ALLOW,
13034
+ failStrategy: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_2__.RestrictionType.ALLOW,
13035
+ shouldSendRestrictionEmail: false
13036
+ };
13037
+ const nextConfig = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, currentConfig, configOverrides);
13038
+ setCountryRestrictionsState({
13039
+ saving: true,
13040
+ error: null
13041
+ });
13042
+ try {
13043
+ await api.auth.updateCountryRestrictionsConfig(nextConfig);
13044
+ const [config, restrictions] = await Promise.all([api.auth.getCountryRestrictionsConfig(), api.auth.getCountryRestrictions()]);
13045
+ setCountryRestrictionsState({
13046
+ data: {
13047
+ config,
13048
+ restrictions
13049
+ },
13050
+ saving: false
13051
+ });
13052
+ callback == null ? void 0 : callback(true);
13053
+ } catch (e) {
13054
+ setCountryRestrictionsState({
13055
+ saving: false,
13056
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_4__.errorHandler)(e)
13057
+ });
13058
+ callback == null ? void 0 : callback(null, e);
13059
+ }
13060
+ };
13061
+ const saveCountryRestrictions = async payload => {
13062
+ const {
13063
+ callback,
13064
+ countryCodes
13065
+ } = payload;
13066
+ setCountryRestrictionsState({
13067
+ saving: true,
13068
+ error: null
13069
+ });
13070
+ try {
13071
+ const uniqueUpper = Array.from(new Set(countryCodes.map(code => code.toUpperCase())));
13072
+ await api.auth.updateCountryRestrictions({
13073
+ countries: uniqueUpper.map(countryCode => ({
13074
+ countryCode
13075
+ }))
13076
+ });
13077
+ const [config, restrictions] = await Promise.all([api.auth.getCountryRestrictionsConfig(), api.auth.getCountryRestrictions()]);
13078
+ setCountryRestrictionsState({
13079
+ data: {
13080
+ config,
13081
+ restrictions
13082
+ },
13083
+ saving: false
13084
+ });
13085
+ callback == null ? void 0 : callback(true);
13086
+ } catch (e) {
13087
+ setCountryRestrictionsState({
13088
+ saving: false,
13089
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_4__.errorHandler)(e)
13090
+ });
13091
+ callback == null ? void 0 : callback(null, e);
13092
+ }
13093
+ };
13007
13094
  const wrappedLoadIpRestrictions = __securityCenterSagaWrapper(loadIpRestrictions);
13008
13095
  const wrappedSaveIpRestriction = __securityCenterSagaWrapper(saveIpRestriction);
13009
13096
  const wrappedSaveIpRestrictionsConfig = __securityCenterSagaWrapper(saveIpRestrictionsConfig);
@@ -13014,11 +13101,15 @@ const _excluded = ["callback"],
13014
13101
  const wrappedSaveEmailDomainRestriction = __securityCenterSagaWrapper(saveEmailDomainRestriction);
13015
13102
  const wrappedSaveEmailDomainRestrictionsConfig = __securityCenterSagaWrapper(saveEmailDomainRestrictionsConfig);
13016
13103
  const wrappedDeleteEmailDomainRestriction = __securityCenterSagaWrapper(deleteEmailDomainRestriction);
13104
+ const wrappedLoadCountryRestrictions = __securityCenterSagaWrapper(loadCountryRestrictions);
13105
+ const wrappedSaveCountryRestrictionsConfig = __securityCenterSagaWrapper(saveCountryRestrictionsConfig);
13106
+ const wrappedSaveCountryRestrictions = __securityCenterSagaWrapper(saveCountryRestrictions);
13017
13107
  return {
13018
13108
  // reducers
13019
13109
  setRestrictionsState,
13020
13110
  setIpRestrictionsState,
13021
13111
  setEmailDomainRestrictionsState,
13112
+ setCountryRestrictionsState,
13022
13113
  __securityCenterSagaWrapper,
13023
13114
  // actions
13024
13115
  loadIpRestrictions: wrappedLoadIpRestrictions,
@@ -13030,7 +13121,10 @@ const _excluded = ["callback"],
13030
13121
  loadEmailDomainRestrictions: wrappedLoadEmailDomainRestrictions,
13031
13122
  saveEmailDomainRestriction: wrappedSaveEmailDomainRestriction,
13032
13123
  saveEmailDomainRestrictionsConfig: wrappedSaveEmailDomainRestrictionsConfig,
13033
- deleteEmailDomainRestriction: wrappedDeleteEmailDomainRestriction
13124
+ deleteEmailDomainRestriction: wrappedDeleteEmailDomainRestriction,
13125
+ loadCountryRestrictions: wrappedLoadCountryRestrictions,
13126
+ saveCountryRestrictionsConfig: wrappedSaveCountryRestrictionsConfig,
13127
+ saveCountryRestrictions: wrappedSaveCountryRestrictions
13034
13128
  };
13035
13129
  });
13036
13130
 
@@ -13065,6 +13159,9 @@ const initialState = {
13065
13159
  },
13066
13160
  emailDomainRestrictions: {
13067
13161
  loading: false
13162
+ },
13163
+ countryRestrictions: {
13164
+ loading: false
13068
13165
  }
13069
13166
  };
13070
13167
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (overrideState => (0,_toolkit_proxy__WEBPACK_IMPORTED_MODULE_1__.createProxy)(initialState, overrideState));
@@ -20086,7 +20183,7 @@ __webpack_require__.r(__webpack_exports__);
20086
20183
  /* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
20087
20184
  /* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
20088
20185
  /* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
20089
- /** @license Frontegg v7.105.0-alpha.0
20186
+ /** @license Frontegg v7.105.0
20090
20187
  *
20091
20188
  * This source code is licensed under the MIT license found in the
20092
20189
  * LICENSE file in the root directory of this source tree.
@@ -21987,7 +22084,8 @@ __webpack_require__.r(__webpack_exports__);
21987
22084
  const _excluded = ["callback"],
21988
22085
  _excluded2 = ["callback"],
21989
22086
  _excluded3 = ["callback"],
21990
- _excluded4 = ["callback"];
22087
+ _excluded4 = ["callback"],
22088
+ _excluded5 = ["callback"];
21991
22089
 
21992
22090
 
21993
22091
 
@@ -21996,7 +22094,7 @@ const _excluded = ["callback"],
21996
22094
 
21997
22095
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((store, api, actions) => {
21998
22096
  const originalActions = (0,_auth_Security_RestrictionsState__WEBPACK_IMPORTED_MODULE_2__["default"])(store, api, actions);
21999
- const mockedActions = (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.mockActionsExpect)(originalActions, ['setRestrictionsState', 'setIpRestrictionsState', 'setEmailDomainRestrictionsState']);
22097
+ const mockedActions = (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.mockActionsExpect)(originalActions, ['setRestrictionsState', 'setIpRestrictionsState', 'setEmailDomainRestrictionsState', 'setCountryRestrictionsState']);
22000
22098
  mockedActions.loadIpRestrictions = async () => {
22001
22099
  mockedActions.setIpRestrictionsState({
22002
22100
  loading: true,
@@ -22037,6 +22135,27 @@ const _excluded = ["callback"],
22037
22135
  }
22038
22136
  });
22039
22137
  };
22138
+ mockedActions.loadCountryRestrictions = async () => {
22139
+ mockedActions.setCountryRestrictionsState({
22140
+ loading: true,
22141
+ error: null
22142
+ });
22143
+ mockedActions.setCountryRestrictionsState({
22144
+ loading: false,
22145
+ data: {
22146
+ restrictions: [{
22147
+ id: '1',
22148
+ countryCode: 'US'
22149
+ }],
22150
+ config: {
22151
+ enabled: true,
22152
+ action: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_5__.RestrictionType.ALLOW,
22153
+ failStrategy: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_5__.RestrictionType.ALLOW,
22154
+ shouldSendRestrictionEmail: false
22155
+ }
22156
+ }
22157
+ });
22158
+ };
22040
22159
  mockedActions.saveIpRestriction = async payload => {
22041
22160
  var _ipRestrictionsState$, _ipRestrictionsState$2, _newRestriction$isAct;
22042
22161
  const {
@@ -22205,6 +22324,62 @@ const _excluded = ["callback"],
22205
22324
  saving: false
22206
22325
  });
22207
22326
  };
22327
+ mockedActions.saveCountryRestrictionsConfig = async payload => {
22328
+ var _ref, _config$enabled, _countryRestrictionsS, _ref2, _config$action, _countryRestrictionsS2, _ref3, _config$failStrategy, _countryRestrictionsS3, _ref4, _config$shouldSendRes, _countryRestrictionsS4, _countryRestrictionsS5;
22329
+ const {
22330
+ callback
22331
+ } = payload,
22332
+ config = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(payload, _excluded5);
22333
+ const countryRestrictionsState = store.auth.restrictionsState.countryRestrictions;
22334
+ mockedActions.setCountryRestrictionsState({
22335
+ saving: true,
22336
+ error: null
22337
+ });
22338
+ await (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.delay)();
22339
+ callback == null ? void 0 : callback(true);
22340
+ mockedActions.setCountryRestrictionsState({
22341
+ data: {
22342
+ config: {
22343
+ enabled: (_ref = (_config$enabled = config.enabled) != null ? _config$enabled : (_countryRestrictionsS = countryRestrictionsState.data) == null ? void 0 : _countryRestrictionsS.config.enabled) != null ? _ref : false,
22344
+ action: (_ref2 = (_config$action = config.action) != null ? _config$action : (_countryRestrictionsS2 = countryRestrictionsState.data) == null ? void 0 : _countryRestrictionsS2.config.action) != null ? _ref2 : _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_5__.RestrictionType.ALLOW,
22345
+ failStrategy: (_ref3 = (_config$failStrategy = config.failStrategy) != null ? _config$failStrategy : (_countryRestrictionsS3 = countryRestrictionsState.data) == null ? void 0 : _countryRestrictionsS3.config.failStrategy) != null ? _ref3 : _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_5__.RestrictionType.ALLOW,
22346
+ shouldSendRestrictionEmail: (_ref4 = (_config$shouldSendRes = config.shouldSendRestrictionEmail) != null ? _config$shouldSendRes : (_countryRestrictionsS4 = countryRestrictionsState.data) == null ? void 0 : _countryRestrictionsS4.config.shouldSendRestrictionEmail) != null ? _ref4 : false
22347
+ },
22348
+ restrictions: [...(((_countryRestrictionsS5 = countryRestrictionsState.data) == null ? void 0 : _countryRestrictionsS5.restrictions) || [])]
22349
+ },
22350
+ saving: false
22351
+ });
22352
+ };
22353
+ mockedActions.saveCountryRestrictions = async payload => {
22354
+ var _countryRestrictionsS6, _countryRestrictionsS7;
22355
+ const {
22356
+ callback,
22357
+ countryCodes
22358
+ } = payload;
22359
+ const countryRestrictionsState = store.auth.restrictionsState.countryRestrictions;
22360
+ mockedActions.setCountryRestrictionsState({
22361
+ saving: true,
22362
+ error: null
22363
+ });
22364
+ await (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.delay)();
22365
+ callback == null ? void 0 : callback(true);
22366
+ const restrictions = Array.from(new Set(countryCodes.map(code => code.toUpperCase()))).map((countryCode, index) => ({
22367
+ id: `mock-${countryCode}-${index}`,
22368
+ countryCode
22369
+ }));
22370
+ mockedActions.setCountryRestrictionsState({
22371
+ data: {
22372
+ config: (_countryRestrictionsS6 = (_countryRestrictionsS7 = countryRestrictionsState.data) == null ? void 0 : _countryRestrictionsS7.config) != null ? _countryRestrictionsS6 : {
22373
+ enabled: true,
22374
+ action: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_5__.RestrictionType.ALLOW,
22375
+ failStrategy: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_5__.RestrictionType.ALLOW,
22376
+ shouldSendRestrictionEmail: false
22377
+ },
22378
+ restrictions
22379
+ },
22380
+ saving: false
22381
+ });
22382
+ };
22208
22383
  mockedActions.deleteEmailDomainRestriction = async payload => {
22209
22384
  var _emailDomainRestricti4, _emailDomainRestricti5;
22210
22385
  const {
@@ -29181,6 +29356,10 @@ class AuthenticationApi extends _BaseApiClient__WEBPACK_IMPORTED_MODULE_6__.Base
29181
29356
  this.deleteIPRestriction = this.securityPolicy.deleteIPRestriction.bind(this.securityPolicy);
29182
29357
  this.testCurrentIp = this.securityPolicy.testCurrentIp.bind(this.securityPolicy);
29183
29358
  this.testCurrentIpInAllowList = this.securityPolicy.testCurrentIpInAllowList.bind(this.securityPolicy);
29359
+ this.getCountryRestrictionsConfig = this.securityPolicy.getCountryRestrictionsConfig.bind(this.securityPolicy);
29360
+ this.updateCountryRestrictionsConfig = this.securityPolicy.updateCountryRestrictionsConfig.bind(this.securityPolicy);
29361
+ this.getCountryRestrictions = this.securityPolicy.getCountryRestrictions.bind(this.securityPolicy);
29362
+ this.updateCountryRestrictions = this.securityPolicy.updateCountryRestrictions.bind(this.securityPolicy);
29184
29363
  }
29185
29364
  /**
29186
29365
  * @returns true if entitlements load should be done
@@ -29399,6 +29578,18 @@ class SecurityPolicyApi extends _BaseApiClient__WEBPACK_IMPORTED_MODULE_0__.Base
29399
29578
  this.testCurrentIpInAllowList = async () => {
29400
29579
  return this.post(`${_constants__WEBPACK_IMPORTED_MODULE_1__.urls.identity.restrictions.ip.v1}/verify/allow`);
29401
29580
  };
29581
+ this.getCountryRestrictionsConfig = async () => {
29582
+ return this.get(_constants__WEBPACK_IMPORTED_MODULE_1__.urls.securityEngines.countryRestriction.v1);
29583
+ };
29584
+ this.updateCountryRestrictionsConfig = async body => {
29585
+ return this.post(_constants__WEBPACK_IMPORTED_MODULE_1__.urls.securityEngines.countryRestriction.v1, body);
29586
+ };
29587
+ this.getCountryRestrictions = async () => {
29588
+ return this.get(`${_constants__WEBPACK_IMPORTED_MODULE_1__.urls.securityEngines.countryRestriction.v1}/countries`);
29589
+ };
29590
+ this.updateCountryRestrictions = async body => {
29591
+ return this.post(`${_constants__WEBPACK_IMPORTED_MODULE_1__.urls.securityEngines.countryRestriction.v1}/countries`, body);
29592
+ };
29402
29593
  }
29403
29594
 
29404
29595
  /** Get global secure access configuration */
@@ -29940,6 +30131,11 @@ const urls = {
29940
30131
  v1: '/security-center/resources/insights/v1'
29941
30132
  }
29942
30133
  },
30134
+ securityEngines: {
30135
+ countryRestriction: {
30136
+ v1: '/security-engines/resources/policies/v1/country-restriction'
30137
+ }
30138
+ },
29943
30139
  applications: {
29944
30140
  v1: '/applications/resources/applications/v1',
29945
30141
  tenant: {
@@ -30464,7 +30660,7 @@ __webpack_require__.r(__webpack_exports__);
30464
30660
  /* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
30465
30661
  /* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
30466
30662
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
30467
- /** @license Frontegg v7.105.0-alpha.0
30663
+ /** @license Frontegg v7.105.0
30468
30664
  *
30469
30665
  * This source code is licensed under the MIT license found in the
30470
30666
  * LICENSE file in the root directory of this source tree.
@@ -33259,7 +33455,7 @@ __webpack_require__.r(__webpack_exports__);
33259
33455
  /* harmony export */ });
33260
33456
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
33261
33457
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
33262
- /** @license Frontegg v7.105.0-alpha.0
33458
+ /** @license Frontegg v7.105.0
33263
33459
  *
33264
33460
  * This source code is licensed under the MIT license found in the
33265
33461
  * LICENSE file in the root directory of this source tree.