@frontegg/js 7.111.0-alpha.3 → 7.111.0-alpha.4

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.
@@ -1924,7 +1924,7 @@ __webpack_require__.r(__webpack_exports__);
1924
1924
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1925
1925
  /* harmony export */ });
1926
1926
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1927
- cdnVersion: '7.111.0-alpha.3'
1927
+ cdnVersion: '7.111.0-alpha.4'
1928
1928
  });
1929
1929
 
1930
1930
  /***/ }),
@@ -6098,28 +6098,28 @@ __webpack_require__.r(__webpack_exports__);
6098
6098
  /* harmony import */ var _mfaWithEmailCode_actions__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./mfaWithEmailCode.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/mfaWithEmailCode.actions.js");
6099
6099
  /* harmony import */ var _mfaWithSMS_actions__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./mfaWithSMS.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/mfaWithSMS.actions.js");
6100
6100
  /* harmony import */ var _mfaWithWebAuthn_actions__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./mfaWithWebAuthn.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/mfaWithWebAuthn.actions.js");
6101
- /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../interfaces */ "../../dist/@frontegg/redux-store/auth/LoginState/interfaces.js");
6102
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/common.js");
6103
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/handlers.js");
6104
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
6101
+ /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../interfaces */ "../../dist/@frontegg/redux-store/auth/LoginState/interfaces.js");
6102
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/common.js");
6103
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/handlers.js");
6104
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
6105
6105
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/encoders.js");
6106
6106
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/converters.js");
6107
- /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../state */ "../../dist/@frontegg/redux-store/auth/LoginState/state.js");
6108
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../helpers */ "../../dist/@frontegg/redux-store/auth/LoginState/helpers.js");
6107
+ /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../state */ "../../dist/@frontegg/redux-store/auth/LoginState/state.js");
6108
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../helpers */ "../../dist/@frontegg/redux-store/auth/LoginState/helpers.js");
6109
6109
  /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/ContextHolder/index.js");
6110
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/utils.js");
6111
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/feature-flags/index.js");
6112
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/enums.js");
6110
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/feature-flags/index.js");
6111
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/enums.js");
6112
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/utils.js");
6113
6113
  /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/interfaces.js");
6114
6114
  /* harmony import */ var _hostedLoginAuthorize_actions__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./hostedLoginAuthorize.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/hostedLoginAuthorize.actions.js");
6115
- /* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/auth/Entitlements/helpers.js");
6116
- /* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/toolkit/FronteggNativeModule.js");
6117
- /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../interfaces */ "../../dist/@frontegg/redux-store/auth/interfaces.js");
6115
+ /* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/auth/Entitlements/helpers.js");
6116
+ /* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/toolkit/FronteggNativeModule.js");
6117
+ /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../interfaces */ "../../dist/@frontegg/redux-store/auth/interfaces.js");
6118
6118
  /* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../consts */ "../../dist/@frontegg/redux-store/auth/LoginState/consts.js");
6119
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/helpers.js");
6119
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/helpers.js");
6120
6120
  /* harmony import */ var _MfaState_interfaces__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../MfaState/interfaces */ "../../dist/@frontegg/redux-store/auth/MfaState/interfaces.js");
6121
- /* harmony import */ var _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../SSOState/interfaces */ "../../dist/@frontegg/redux-store/auth/SSOState/interfaces.js");
6122
- /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../constants */ "../../dist/@frontegg/redux-store/constants.js");
6121
+ /* harmony import */ var _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../SSOState/interfaces */ "../../dist/@frontegg/redux-store/auth/SSOState/interfaces.js");
6122
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../constants */ "../../dist/@frontegg/redux-store/constants.js");
6123
6123
 
6124
6124
 
6125
6125
  const _excluded = ["callback", "error"],
@@ -6173,13 +6173,10 @@ const _excluded = ["callback", "error"],
6173
6173
  return;
6174
6174
  }
6175
6175
  try {
6176
- const tabTenantId = (0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.getTabTenantFromSessionStorage)(store.root.appName);
6177
- const body = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({
6176
+ const body = {
6178
6177
  grant_type: 'refresh_token',
6179
6178
  refresh_token: user == null ? void 0 : user.refreshToken
6180
- }, tabTenantId ? {
6181
- tenantId: tabTenantId
6182
- } : {});
6179
+ };
6183
6180
  const response = await api.auth.exchangeOAuthTokensV2(body);
6184
6181
  const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
6185
6182
  actions.afterAuthenticationStateUpdate((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, response, {
@@ -6219,7 +6216,7 @@ const _excluded = ["callback", "error"],
6219
6216
  tenants = [],
6220
6217
  activeTenant
6221
6218
  } = await api.auth.refreshTokenV3();
6222
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isMfaRequired)(user, store.root.appName)) {
6219
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isMfaRequired)(user, store.root.appName)) {
6223
6220
  const mfaRequiredState = await actions.getMfaRequiredState(user);
6224
6221
  actions.setAuthState(mfaRequiredState);
6225
6222
  onRedirectTo(routes.loginUrl, {
@@ -6240,7 +6237,7 @@ const _excluded = ["callback", "error"],
6240
6237
  }, {
6241
6238
  loginState: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, loginState, {
6242
6239
  quickLoginToRegister,
6243
- flow: shouldNavigateToRegisterQuickLogin ? _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.RegisterQuickLogin : _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.Login
6240
+ flow: shouldNavigateToRegisterQuickLogin ? _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.RegisterQuickLogin : _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.Login
6244
6241
  }),
6245
6242
  isAuthenticated: true
6246
6243
  });
@@ -6281,7 +6278,7 @@ const _excluded = ["callback", "error"],
6281
6278
  var _store$auth$user;
6282
6279
  // @ts-ignore TODO: fix entitlements state type
6283
6280
  const oldEntitlements = (_store$auth$user = store.auth.user) == null ? void 0 : _store$auth$user.entitlements;
6284
- if ((0,_toolkit__WEBPACK_IMPORTED_MODULE_6__.isEntitlementsDeeplyEqual)(oldEntitlements, updatedUser == null ? void 0 : updatedUser.entitlements)) {
6281
+ if ((0,_toolkit__WEBPACK_IMPORTED_MODULE_5__.isEntitlementsDeeplyEqual)(oldEntitlements, updatedUser == null ? void 0 : updatedUser.entitlements)) {
6285
6282
  // set the previous entitlements object
6286
6283
  return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, updatedUser, {
6287
6284
  entitlements: oldEntitlements
@@ -6301,7 +6298,7 @@ const _excluded = ["callback", "error"],
6301
6298
  loginState,
6302
6299
  onRedirectTo
6303
6300
  } = store.auth;
6304
- const [preventAuthRedirectOnSocialLogin] = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_7__.FeatureFlags.getFeatureFlags(['prevent-auth-redirect-on-social-login'], store.root.appName);
6301
+ const [preventAuthRedirectOnSocialLogin] = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_6__.FeatureFlags.getFeatureFlags(['prevent-auth-redirect-on-social-login'], store.root.appName);
6305
6302
  const invitationToken = url.searchParams.get('invitationToken');
6306
6303
  const redirectRoutes = [routes.socialLoginCallbackUrl, routes.oidcRedirectUrl, routes.samlCallbackUrl, routes.magicLinkCallbackUrl];
6307
6304
  if (!invitationToken) {
@@ -6330,7 +6327,7 @@ const _excluded = ["callback", "error"],
6330
6327
  var _payload$callback;
6331
6328
  const {
6332
6329
  isActive
6333
- } = await (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.retryIfNeeded)(api.auth.getSSOPublicConfiguration, payload == null ? void 0 : payload.retryConfig);
6330
+ } = await (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.retryIfNeeded)(api.auth.getSSOPublicConfiguration, payload == null ? void 0 : payload.retryConfig);
6334
6331
  actions.setAuthState({
6335
6332
  isSSOAuth: isActive
6336
6333
  });
@@ -6349,7 +6346,7 @@ const _excluded = ["callback", "error"],
6349
6346
  let ssoACS;
6350
6347
  try {
6351
6348
  var _metadata$configurati;
6352
- const metadata = await (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.retryIfNeeded)(api.metadata.getSamlMetadata, payload == null ? void 0 : payload.retryConfig);
6349
+ const metadata = await (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.retryIfNeeded)(api.metadata.getSamlMetadata, payload == null ? void 0 : payload.retryConfig);
6353
6350
  ssoACS = metadata == null ? void 0 : (_metadata$configurati = metadata.configuration) == null ? void 0 : _metadata$configurati.acsUrl;
6354
6351
  } catch (e) {
6355
6352
  console.error(e);
@@ -6375,8 +6372,8 @@ const _excluded = ["callback", "error"],
6375
6372
  onRedirectTo,
6376
6373
  routes
6377
6374
  } = store.auth;
6378
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isMfaRequired)(user, store.root.appName)) {
6379
- const mfaRequiredState = await actions.getMfaRequiredState(user, _constants__WEBPACK_IMPORTED_MODULE_9__.DEFAULT_RETRY_CONFIG, true);
6375
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isMfaRequired)(user, store.root.appName)) {
6376
+ const mfaRequiredState = await actions.getMfaRequiredState(user, _constants__WEBPACK_IMPORTED_MODULE_8__.DEFAULT_RETRY_CONFIG, true);
6380
6377
  actions.setAuthState(mfaRequiredState);
6381
6378
  onRedirectTo(routes.loginUrl, {
6382
6379
  preserveQueryParams: true
@@ -6387,17 +6384,17 @@ const _excluded = ["callback", "error"],
6387
6384
  Object.assign(store.auth.loginState, state);
6388
6385
  };
6389
6386
  const resetLoginState = () => {
6390
- (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.deepResetState)(store, ['auth', 'loginState'], _state__WEBPACK_IMPORTED_MODULE_10__.initialState);
6387
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.deepResetState)(store, ['auth', 'loginState'], _state__WEBPACK_IMPORTED_MODULE_9__.initialState);
6391
6388
  };
6392
6389
  const getRetryWithBlockingCallbackPayload = requestName => {
6393
6390
  const callback = (_, error) => {
6394
6391
  if (!error || error.statusCode < 500) return;
6395
6392
  actions.setErrorByRequestName({
6396
6393
  requestName,
6397
- traceId: (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.errorTraceId)(error)
6394
+ traceId: (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.errorTraceId)(error)
6398
6395
  });
6399
6396
  };
6400
- return (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.withRetryConfig)({
6397
+ return (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.withRetryConfig)({
6401
6398
  callback
6402
6399
  });
6403
6400
  };
@@ -6409,19 +6406,19 @@ const _excluded = ["callback", "error"],
6409
6406
  actions.setAuthState({
6410
6407
  isLoading: true
6411
6408
  });
6412
- calls.push(actions.loadSocialLoginsConfigurationV2((0,_helpers__WEBPACK_IMPORTED_MODULE_8__.withRetryConfig)()));
6413
- calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
6414
- calls.push(actions.loadPublicAuthStrategiesPolicy(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_PUBLIC_AUTH_STRATEGIES_POLICY)));
6409
+ calls.push(actions.loadSocialLoginsConfigurationV2((0,_helpers__WEBPACK_IMPORTED_MODULE_7__.withRetryConfig)()));
6410
+ calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
6411
+ calls.push(actions.loadPublicAuthStrategiesPolicy(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_PUBLIC_AUTH_STRATEGIES_POLICY)));
6415
6412
  calls.push(actions.loadSignUpStrategies());
6416
- calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
6417
- calls.push(actions.loadVendorPublicInfo((0,_helpers__WEBPACK_IMPORTED_MODULE_8__.withRetryConfig)()));
6418
- calls.push(__refreshMetadata((0,_helpers__WEBPACK_IMPORTED_MODULE_8__.withRetryConfig)()));
6413
+ calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
6414
+ calls.push(actions.loadVendorPublicInfo((0,_helpers__WEBPACK_IMPORTED_MODULE_7__.withRetryConfig)()));
6415
+ calls.push(__refreshMetadata((0,_helpers__WEBPACK_IMPORTED_MODULE_7__.withRetryConfig)()));
6419
6416
  /*
6420
6417
  We will load custom login routes only if custom login is enabled
6421
6418
  to check if custom login is enabled without the tenant alias (search-param/subdomain)
6422
6419
  we have to wait for the user state (refreshToken request)
6423
6420
  */
6424
- callsAfterRefresh.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
6421
+ callsAfterRefresh.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
6425
6422
  }
6426
6423
  await Promise.all(calls);
6427
6424
  if (callsAfterRefresh.length > 0) {
@@ -6433,14 +6430,14 @@ const _excluded = ["callback", "error"],
6433
6430
  };
6434
6431
  const requestAuthorizeSSR = async payload => {
6435
6432
  const calls = [];
6436
- calls.push(actions.loadSocialLoginsConfigurationV2((0,_helpers__WEBPACK_IMPORTED_MODULE_8__.withRetryConfig)()));
6437
- calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
6438
- calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
6433
+ calls.push(actions.loadSocialLoginsConfigurationV2((0,_helpers__WEBPACK_IMPORTED_MODULE_7__.withRetryConfig)()));
6434
+ calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
6435
+ calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
6439
6436
  calls.push(actions.loadSignUpStrategies());
6440
- calls.push(actions.loadVendorPublicInfo((0,_helpers__WEBPACK_IMPORTED_MODULE_8__.withRetryConfig)()));
6437
+ calls.push(actions.loadVendorPublicInfo((0,_helpers__WEBPACK_IMPORTED_MODULE_7__.withRetryConfig)()));
6441
6438
  calls.push(__refreshMetadata());
6442
6439
  calls.push(__isMFARequiredSSR(payload));
6443
- calls.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_11__.REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
6440
+ calls.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_10__.REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
6444
6441
  await Promise.all(calls);
6445
6442
  };
6446
6443
  const ssoPreloginFailed = async _ref3 => {
@@ -6452,28 +6449,28 @@ const _excluded = ["callback", "error"],
6452
6449
  const publicPolicy = store.auth.securityPolicyState.publicPolicy.policy;
6453
6450
  if (!(publicPolicy != null && publicPolicy.authStrategy)) {
6454
6451
  actions.setLoginState({
6455
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.loginWithPassword,
6452
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.loginWithPassword,
6456
6453
  loading: false
6457
6454
  });
6458
6455
  callback == null ? void 0 : callback();
6459
6456
  return;
6460
6457
  }
6461
- if ((publicPolicy == null ? void 0 : publicPolicy.authStrategy) === _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.AuthStrategyEnum.EmailAndPassword) {
6458
+ if ((publicPolicy == null ? void 0 : publicPolicy.authStrategy) === _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.AuthStrategyEnum.EmailAndPassword) {
6462
6459
  actions.setLoginState({
6463
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.loginWithPassword,
6460
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.loginWithPassword,
6464
6461
  loading: false
6465
6462
  });
6466
6463
  callback == null ? void 0 : callback();
6467
- } 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)) {
6464
+ } 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)) {
6468
6465
  await actions.passwordlessPreLogin((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, body, {
6469
6466
  type: publicPolicy == null ? void 0 : publicPolicy.authStrategy,
6470
6467
  callback
6471
6468
  }));
6472
6469
  } else {
6473
6470
  actions.setLoginState({
6474
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.loginWithPassword,
6471
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.loginWithPassword,
6475
6472
  loading: false,
6476
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(error)
6473
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(error)
6477
6474
  });
6478
6475
  callback == null ? void 0 : callback();
6479
6476
  }
@@ -6491,7 +6488,7 @@ const _excluded = ["callback", "error"],
6491
6488
  });
6492
6489
  try {
6493
6490
  const onRedirectTo = store.auth.onRedirectTo;
6494
- const tenantId = (0,_helpers__WEBPACK_IMPORTED_MODULE_14__.getSearchParam)(_helpers__WEBPACK_IMPORTED_MODULE_14__.TENANT_ID_PARAM_KEY);
6491
+ const tenantId = (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.getSearchParam)(_helpers__WEBPACK_IMPORTED_MODULE_13__.TENANT_ID_PARAM_KEY);
6495
6492
  const preLoginResult = await api.auth.preLoginV2((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, email ? {
6496
6493
  email
6497
6494
  } : {}, username ? {
@@ -6505,22 +6502,22 @@ const _excluded = ["callback", "error"],
6505
6502
  } = preLoginResult != null ? preLoginResult : {};
6506
6503
  if (address) {
6507
6504
  let ssoRedirectUrl = address;
6508
- if (idpType === _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_15__.SamlVendors.Oidc && !ssoRedirectUrl.includes('redirect_uri')) {
6505
+ if (idpType === _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_14__.SamlVendors.Oidc && !ssoRedirectUrl.includes('redirect_uri')) {
6509
6506
  const {
6510
6507
  oidcRedirectUrl
6511
6508
  } = store.auth.routes;
6512
6509
  ssoRedirectUrl += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
6513
6510
  }
6514
- if (_toolkit__WEBPACK_IMPORTED_MODULE_16__["default"].isLoginWithSSOAvailable()) {
6511
+ if (_toolkit__WEBPACK_IMPORTED_MODULE_15__["default"].isLoginWithSSOAvailable()) {
6515
6512
  var _ref4;
6516
- _toolkit__WEBPACK_IMPORTED_MODULE_16__["default"].loginWithSSO((_ref4 = email != null ? email : username) != null ? _ref4 : '');
6513
+ _toolkit__WEBPACK_IMPORTED_MODULE_15__["default"].loginWithSSO((_ref4 = email != null ? email : username) != null ? _ref4 : '');
6517
6514
  setLoginState({
6518
6515
  loading: false
6519
6516
  });
6520
6517
  callback == null ? void 0 : callback();
6521
6518
  } else {
6522
6519
  setLoginState({
6523
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.redirectToSSO,
6520
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.redirectToSSO,
6524
6521
  loading: false,
6525
6522
  ssoRedirectUrl
6526
6523
  });
@@ -6531,23 +6528,27 @@ const _excluded = ["callback", "error"],
6531
6528
  }, 2000);
6532
6529
  }
6533
6530
  } else {
6534
- var _ref5;
6535
- await ssoPreloginFailed({
6536
- email: (_ref5 = email != null ? email : username) != null ? _ref5 : '',
6531
+ await ssoPreloginFailed((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, username ? {
6532
+ username
6533
+ } : {
6534
+ email: email != null ? email : ''
6535
+ }, {
6537
6536
  recaptchaToken,
6538
6537
  callback,
6539
6538
  invitationToken
6540
- });
6539
+ }));
6541
6540
  }
6542
6541
  } catch (e) {
6543
- var _ref6;
6544
- await ssoPreloginFailed({
6545
- email: (_ref6 = email != null ? email : username) != null ? _ref6 : '',
6542
+ await ssoPreloginFailed((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, username ? {
6543
+ username
6544
+ } : {
6545
+ email: email != null ? email : ''
6546
+ }, {
6546
6547
  recaptchaToken,
6547
6548
  callback,
6548
6549
  invitationToken,
6549
6550
  error: e
6550
- });
6551
+ }));
6551
6552
  }
6552
6553
  };
6553
6554
  const postLogin = async payload => {
@@ -6575,7 +6576,7 @@ const _excluded = ["callback", "error"],
6575
6576
  email: user.email,
6576
6577
  name: user.name
6577
6578
  };
6578
- (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_17__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
6579
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
6579
6580
  }
6580
6581
  await actions.afterAuthNavigation();
6581
6582
  } catch (e) {
@@ -6583,7 +6584,7 @@ const _excluded = ["callback", "error"],
6583
6584
  onRedirectTo(routes.authenticatedUrl);
6584
6585
  }, 1000);
6585
6586
  setLoginState({
6586
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.loginWithSSOFailed,
6587
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.loginWithSSOFailed,
6587
6588
  loading: false
6588
6589
  });
6589
6590
  }
@@ -6618,17 +6619,17 @@ const _excluded = ["callback", "error"],
6618
6619
  onRedirectTo,
6619
6620
  routes
6620
6621
  } = store.auth;
6621
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isMfaRequired)(user, store.root.appName)) {
6622
- const mfaRequiredState = await actions.getMfaRequiredState(user, _constants__WEBPACK_IMPORTED_MODULE_9__.DEFAULT_RETRY_CONFIG, true, email);
6622
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isMfaRequired)(user, store.root.appName)) {
6623
+ const mfaRequiredState = await actions.getMfaRequiredState(user, _constants__WEBPACK_IMPORTED_MODULE_8__.DEFAULT_RETRY_CONFIG, true, email);
6623
6624
  actions.setAuthState(mfaRequiredState);
6624
6625
  onRedirectTo(routes.loginUrl, {
6625
6626
  preserveQueryParams: true
6626
6627
  });
6627
6628
  } else {
6628
6629
  const [securityCenterLoginFlows] = await actions.getFeatureFlags(['security-center-show-login-flows']);
6629
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isResetPasswordRequired)(user, store.root.appName)) {
6630
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isResetPasswordRequired)(user, store.root.appName)) {
6630
6631
  setLoginState({
6631
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.passwordRotationExpired,
6632
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.passwordRotationExpired,
6632
6633
  loading: false,
6633
6634
  resetPasswordToken: user.resetPasswordToken,
6634
6635
  userId: user.userId
@@ -6651,7 +6652,7 @@ const _excluded = ["callback", "error"],
6651
6652
  loading: false,
6652
6653
  error: undefined,
6653
6654
  mfaToken: user.mfaToken,
6654
- step: loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.Login ? _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.success : loginState.step,
6655
+ step: loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.Login ? _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.success : loginState.step,
6655
6656
  tenants,
6656
6657
  tenantsLoading: true,
6657
6658
  isBreachedPassword: user.isBreachedPassword
@@ -6668,27 +6669,27 @@ const _excluded = ["callback", "error"],
6668
6669
  email,
6669
6670
  name: user.name
6670
6671
  };
6671
- (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_17__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
6672
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
6672
6673
  }
6673
- if (loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.Login) {
6674
+ if (loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.Login) {
6674
6675
  if (securityCenterLoginFlows && user.isBreachedPassword && !isAuthenticated) {
6675
6676
  setLoginState({
6676
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.breachedPassword,
6677
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.breachedPassword,
6677
6678
  loading: false
6678
6679
  });
6679
6680
  } else {
6680
6681
  if (isAuthenticated) {
6681
- const shouldShowPasswordRotationPrompt = (0,_helpers__WEBPACK_IMPORTED_MODULE_14__.shouldShowPasswordRotationPromptFunc)(user);
6682
+ const shouldShowPasswordRotationPrompt = (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.shouldShowPasswordRotationPromptFunc)(user);
6682
6683
  if (shouldShowPasswordRotationPrompt) {
6683
6684
  setLoginState({
6684
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.passwordRotationNotification,
6685
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.passwordRotationNotification,
6685
6686
  loading: false
6686
6687
  });
6687
6688
  } else {
6688
6689
  const shouldShowPromptPasskeys = await actions.__shouldShowPromptPasskeys();
6689
6690
  if (shouldShowPromptPasskeys) {
6690
6691
  setLoginState({
6691
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.promptPasskeys,
6692
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.promptPasskeys,
6692
6693
  loading: false
6693
6694
  });
6694
6695
  onRedirectTo(routes.loginUrl, {
@@ -6703,8 +6704,8 @@ const _excluded = ["callback", "error"],
6703
6704
  }
6704
6705
  }
6705
6706
  }
6706
- if (_toolkit__WEBPACK_IMPORTED_MODULE_16__["default"].isSuggestSavePasswordAvailable()) {
6707
- _toolkit__WEBPACK_IMPORTED_MODULE_16__["default"].suggestSavePassword(email, password);
6707
+ if (_toolkit__WEBPACK_IMPORTED_MODULE_15__["default"].isSuggestSavePasswordAvailable()) {
6708
+ _toolkit__WEBPACK_IMPORTED_MODULE_15__["default"].suggestSavePassword(email, password);
6708
6709
  }
6709
6710
 
6710
6711
  // TODO: extract item name to constants
@@ -6716,7 +6717,7 @@ const _excluded = ["callback", "error"],
6716
6717
  callback == null ? void 0 : callback(false, e);
6717
6718
  setLoginState({
6718
6719
  email,
6719
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e),
6720
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e),
6720
6721
  loading: false
6721
6722
  });
6722
6723
  }
@@ -6736,7 +6737,7 @@ const _excluded = ["callback", "error"],
6736
6737
  /* empty */
6737
6738
  }
6738
6739
  if (contextHolder.isSessionPerTenantEnabled()) {
6739
- (0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.removeTabTenantFromSessionStorage)();
6740
+ (0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__.removeTabTenantFromSessionStorage)();
6740
6741
  }
6741
6742
  actions.resetAuthState();
6742
6743
  await actions.requestAuthorize(true);
@@ -6750,7 +6751,7 @@ const _excluded = ["callback", "error"],
6750
6751
  /* empty */
6751
6752
  }
6752
6753
  if (contextHolder.isSessionPerTenantEnabled()) {
6753
- (0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.removeTabTenantFromSessionStorage)();
6754
+ (0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__.removeTabTenantFromSessionStorage)();
6754
6755
  }
6755
6756
  setTimeout(() => {
6756
6757
  var _payload$callback3;
@@ -6767,7 +6768,7 @@ const _excluded = ["callback", "error"],
6767
6768
  setLoginState({
6768
6769
  loading: false,
6769
6770
  error: undefined,
6770
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.preLogin
6771
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.preLogin
6771
6772
  });
6772
6773
  actions.setAuthState({
6773
6774
  user: undefined,
@@ -6777,7 +6778,7 @@ const _excluded = ["callback", "error"],
6777
6778
  } catch (e) {
6778
6779
  var _payload$callback5;
6779
6780
  setLoginState({
6780
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e),
6781
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e),
6781
6782
  loading: false
6782
6783
  });
6783
6784
  (_payload$callback5 = payload.callback) == null ? void 0 : _payload$callback5.call(payload, false, e);
@@ -6796,10 +6797,10 @@ const _excluded = ["callback", "error"],
6796
6797
  // TODO: fix @frontegg/rest-api return value
6797
6798
  // @ts-ignore
6798
6799
  const preloginRes = await api.auth.passwordlessPreLogin((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, payload, {
6799
- type: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.AuthStrategyEnum.SmsCode
6800
+ type: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.AuthStrategyEnum.SmsCode
6800
6801
  }));
6801
6802
  setLoginState({
6802
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.loginWithQuickSmsOtc,
6803
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.loginWithQuickSmsOtc,
6803
6804
  loading: false,
6804
6805
  phoneNumber: preloginRes == null ? void 0 : preloginRes.phoneNumber,
6805
6806
  error: undefined
@@ -6807,7 +6808,7 @@ const _excluded = ["callback", "error"],
6807
6808
  callback == null ? void 0 : callback(true);
6808
6809
  } catch (e) {
6809
6810
  setLoginState({
6810
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e),
6811
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e),
6811
6812
  loading: false
6812
6813
  });
6813
6814
  callback == null ? void 0 : callback(false, e);
@@ -6827,13 +6828,13 @@ const _excluded = ["callback", "error"],
6827
6828
  phoneNumber: payload.phoneNumber,
6828
6829
  loading: false,
6829
6830
  changePhoneId: changePhoneRes.changePhoneId,
6830
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.loginWithQuickSmsOtc,
6831
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.loginWithQuickSmsOtc,
6831
6832
  error: undefined
6832
6833
  });
6833
6834
  callback == null ? void 0 : callback(true);
6834
6835
  } catch (e) {
6835
6836
  setLoginState({
6836
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e),
6837
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e),
6837
6838
  loading: false
6838
6839
  });
6839
6840
  }
@@ -6854,7 +6855,7 @@ const _excluded = ["callback", "error"],
6854
6855
  callback == null ? void 0 : callback(true);
6855
6856
  } catch (e) {
6856
6857
  setLoginState({
6857
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e),
6858
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e),
6858
6859
  loading: false
6859
6860
  });
6860
6861
  }
@@ -6870,11 +6871,11 @@ const _excluded = ["callback", "error"],
6870
6871
  loading: true
6871
6872
  });
6872
6873
  let email;
6873
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_14__.isEmailPayload)(payload)) {
6874
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_13__.isEmailPayload)(payload)) {
6874
6875
  email = payload.email;
6875
6876
  }
6876
6877
  let username;
6877
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_14__.isUsernamePayload)(payload)) {
6878
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_13__.isUsernamePayload)(payload)) {
6878
6879
  username = payload.username;
6879
6880
  }
6880
6881
  // TODO: [Typescript 4.8] fix @frontegg/rest-api return value
@@ -6896,7 +6897,7 @@ const _excluded = ["callback", "error"],
6896
6897
  callback == null ? void 0 : callback();
6897
6898
  } catch (e) {
6898
6899
  setLoginState({
6899
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e),
6900
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e),
6900
6901
  loading: false
6901
6902
  });
6902
6903
  callback == null ? void 0 : callback(null, e);
@@ -6921,7 +6922,7 @@ const _excluded = ["callback", "error"],
6921
6922
  routes,
6922
6923
  onRedirectTo
6923
6924
  } = store.auth;
6924
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isMfaRequired)(user, store.root.appName)) {
6925
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isMfaRequired)(user, store.root.appName)) {
6925
6926
  const mfaRequiredState = await actions.getMfaRequiredState(user);
6926
6927
  actions.setAuthState(mfaRequiredState);
6927
6928
  onRedirectTo(routes.loginUrl, {
@@ -6934,14 +6935,14 @@ const _excluded = ["callback", "error"],
6934
6935
  var _events$userVerified;
6935
6936
  const userVerifiedPayload = {
6936
6937
  email: user.email,
6937
- origin: _interfaces__WEBPACK_IMPORTED_MODULE_11__.UserVerifiedOriginTypes.PASSWORDLESS,
6938
+ origin: _interfaces__WEBPACK_IMPORTED_MODULE_10__.UserVerifiedOriginTypes.PASSWORDLESS,
6938
6939
  id: user.id,
6939
6940
  tenantId: user.tenantId,
6940
6941
  createdAt: new Date(),
6941
6942
  name: user.name
6942
6943
  };
6943
6944
  events == null ? void 0 : (_events$userVerified = events.userVerified) == null ? void 0 : _events$userVerified.call(events, userVerifiedPayload);
6944
- (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_17__.GTMEventAction.USER_VERIFIED, userVerifiedPayload);
6945
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.USER_VERIFIED, userVerifiedPayload);
6945
6946
  }
6946
6947
  const loginCompletedPayload = {
6947
6948
  tenantId: user.tenantId,
@@ -6951,7 +6952,7 @@ const _excluded = ["callback", "error"],
6951
6952
  email: user.email,
6952
6953
  name: user.name
6953
6954
  };
6954
- (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_17__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
6955
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
6955
6956
  if (user.id) {
6956
6957
  localStorage.setItem('userId', user.id);
6957
6958
  }
@@ -6966,11 +6967,11 @@ const _excluded = ["callback", "error"],
6966
6967
  actions.setAuthState({
6967
6968
  isLoading: false
6968
6969
  });
6969
- if (loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.Login) {
6970
+ if (loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.Login) {
6970
6971
  const shouldShowPrompt = await actions.__shouldShowPromptPasskeys();
6971
6972
  if (shouldShowPrompt) {
6972
6973
  actions.setLoginState({
6973
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.promptPasskeys,
6974
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.promptPasskeys,
6974
6975
  loading: false
6975
6976
  });
6976
6977
  onRedirectTo(routes.loginUrl, {
@@ -6980,12 +6981,12 @@ const _excluded = ["callback", "error"],
6980
6981
  actions.setAuthState({
6981
6982
  isAuthenticated: true
6982
6983
  });
6983
- if (_payload.type === _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.AuthStrategyEnum.MagicLink) {
6984
+ if (_payload.type === _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.AuthStrategyEnum.MagicLink) {
6984
6985
  actions.setLoginState({
6985
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.magicLinkPostLoginSuccess,
6986
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.magicLinkPostLoginSuccess,
6986
6987
  loading: false
6987
6988
  });
6988
- await (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.delay)(5000);
6989
+ await (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.delay)(5000);
6989
6990
  }
6990
6991
  await actions.afterAuthNavigation();
6991
6992
  }
@@ -6999,7 +7000,7 @@ const _excluded = ["callback", "error"],
6999
7000
  }
7000
7001
  } catch (e) {
7001
7002
  setLoginState({
7002
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e, 'Failed to authenticate')
7003
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e, 'Failed to authenticate')
7003
7004
  });
7004
7005
  callback == null ? void 0 : callback(null, e);
7005
7006
  } finally {
@@ -7023,7 +7024,7 @@ const _excluded = ["callback", "error"],
7023
7024
  });
7024
7025
  } catch (e) {
7025
7026
  setLoginState({
7026
- inviteTokenError: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e, `We couldn't verify your invitation`)
7027
+ inviteTokenError: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e, `We couldn't verify your invitation`)
7027
7028
  });
7028
7029
  } finally {
7029
7030
  setLoginState({
@@ -7059,7 +7060,7 @@ const _excluded = ["callback", "error"],
7059
7060
  callback == null ? void 0 : callback(options);
7060
7061
  } catch (e) {
7061
7062
  setLoginState({
7062
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7063
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7063
7064
  });
7064
7065
  callback == null ? void 0 : callback(null);
7065
7066
  } finally {
@@ -7096,7 +7097,7 @@ const _excluded = ["callback", "error"],
7096
7097
  user
7097
7098
  } = _await$api$auth$webAu,
7098
7099
  rest = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_await$api$auth$webAu, _excluded9);
7099
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isMfaRequired)(user, store.root.appName)) {
7100
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isMfaRequired)(user, store.root.appName)) {
7100
7101
  const {
7101
7102
  routes,
7102
7103
  onRedirectTo
@@ -7127,7 +7128,7 @@ const _excluded = ["callback", "error"],
7127
7128
  email: user.email,
7128
7129
  name: user.name
7129
7130
  };
7130
- (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_17__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
7131
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
7131
7132
  await actions.afterAuthNavigation();
7132
7133
  // TODO: Itamar why moving callback to inside the else block
7133
7134
  callback == null ? void 0 : callback(true);
@@ -7135,7 +7136,7 @@ const _excluded = ["callback", "error"],
7135
7136
  // callback?.(true);
7136
7137
  } catch (e) {
7137
7138
  setLoginState({
7138
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7139
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7139
7140
  });
7140
7141
  callback == null ? void 0 : callback(null);
7141
7142
  } finally {
@@ -7166,7 +7167,7 @@ const _excluded = ["callback", "error"],
7166
7167
  callback == null ? void 0 : callback(options);
7167
7168
  } catch (e) {
7168
7169
  setLoginState({
7169
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7170
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7170
7171
  });
7171
7172
  callback == null ? void 0 : callback(null);
7172
7173
  } finally {
@@ -7194,7 +7195,7 @@ const _excluded = ["callback", "error"],
7194
7195
  callback == null ? void 0 : callback(true);
7195
7196
  } catch (e) {
7196
7197
  setLoginState({
7197
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7198
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7198
7199
  });
7199
7200
  callback == null ? void 0 : callback(null);
7200
7201
  } finally {
@@ -7270,7 +7271,7 @@ const _excluded = ["callback", "error"],
7270
7271
  } catch (e) {
7271
7272
  setLoginState({
7272
7273
  loading: false,
7273
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7274
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7274
7275
  });
7275
7276
  callback == null ? void 0 : callback(null);
7276
7277
  }
@@ -7296,7 +7297,7 @@ const _excluded = ["callback", "error"],
7296
7297
  } catch (e) {
7297
7298
  setLoginState({
7298
7299
  loading: false,
7299
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7300
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7300
7301
  });
7301
7302
  callback == null ? void 0 : callback(null);
7302
7303
  }
@@ -7319,7 +7320,7 @@ const _excluded = ["callback", "error"],
7319
7320
  } catch (e) {
7320
7321
  setLoginState({
7321
7322
  loading: false,
7322
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7323
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7323
7324
  });
7324
7325
  callback == null ? void 0 : callback(null);
7325
7326
  }
@@ -7346,7 +7347,7 @@ const _excluded = ["callback", "error"],
7346
7347
  } catch (e) {
7347
7348
  setLoginState({
7348
7349
  loading: false,
7349
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7350
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7350
7351
  });
7351
7352
  callback == null ? void 0 : callback(null);
7352
7353
  }
@@ -7369,7 +7370,7 @@ const _excluded = ["callback", "error"],
7369
7370
  } catch (e) {
7370
7371
  setLoginState({
7371
7372
  loading: false,
7372
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7373
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7373
7374
  });
7374
7375
  callback == null ? void 0 : callback(null);
7375
7376
  }
@@ -7409,7 +7410,7 @@ const _excluded = ["callback", "error"],
7409
7410
  setLoginState({
7410
7411
  loading: false,
7411
7412
  error: undefined,
7412
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.breachedPasswordSuccess
7413
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.breachedPasswordSuccess
7413
7414
  });
7414
7415
  actions.setAuthState({
7415
7416
  isAuthenticated: false
@@ -7417,7 +7418,7 @@ const _excluded = ["callback", "error"],
7417
7418
  } catch (e) {
7418
7419
  setLoginState({
7419
7420
  loading: false,
7420
- error: (0,_helpers__WEBPACK_IMPORTED_MODULE_13__.errorHandler)(e)
7421
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.errorHandler)(e)
7421
7422
  });
7422
7423
  }
7423
7424
  };
@@ -7437,13 +7438,10 @@ const _excluded = ["callback", "error"],
7437
7438
  return;
7438
7439
  }
7439
7440
  try {
7440
- const tabTenantId = (0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.getTabTenantFromSessionStorage)(store.root.appName);
7441
- const body = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({
7441
+ const body = {
7442
7442
  grant_type: 'refresh_token',
7443
7443
  refresh_token: currentUser == null ? void 0 : currentUser.refreshToken
7444
- }, tabTenantId ? {
7445
- tenantId: tabTenantId
7446
- } : {});
7444
+ };
7447
7445
  const response = await api.auth.exchangeOAuthTokensV2(body);
7448
7446
  const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
7449
7447
  actions.afterAuthenticationStateUpdate((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, response, {
@@ -7473,7 +7471,7 @@ const _excluded = ["callback", "error"],
7473
7471
  tenants = [],
7474
7472
  activeTenant
7475
7473
  } = await api.auth.refreshTokenV3();
7476
- if ((0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isMfaRequired)(user, store.root.appName)) {
7474
+ if ((0,_helpers__WEBPACK_IMPORTED_MODULE_3__.isMfaRequired)(user, store.root.appName)) {
7477
7475
  const mfaRequiredState = await actions.getMfaRequiredState(user);
7478
7476
  actions.setAuthState(mfaRequiredState);
7479
7477
  onRedirectTo(routes.loginUrl, {
@@ -7484,7 +7482,7 @@ const _excluded = ["callback", "error"],
7484
7482
  const shouldShowPrompt = await actions.__shouldShowPromptPasskeys();
7485
7483
  if (shouldShowPrompt) {
7486
7484
  actions.setLoginState({
7487
- step: _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginStep.promptPasskeys,
7485
+ step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginStep.promptPasskeys,
7488
7486
  loading: false
7489
7487
  });
7490
7488
  actions.afterAuthenticationStateUpdate({
@@ -7498,11 +7496,11 @@ const _excluded = ["callback", "error"],
7498
7496
  preserveQueryParams: true
7499
7497
  });
7500
7498
  } else {
7501
- var _ref7;
7499
+ var _ref5;
7502
7500
  if (user.id) {
7503
7501
  localStorage.setItem('userId', user.id);
7504
7502
  }
7505
- const quickLoginToRegister = (_ref7 = localStorage.getItem('register-quick-login')) != null ? _ref7 : loginState.quickLoginToRegister;
7503
+ const quickLoginToRegister = (_ref5 = localStorage.getItem('register-quick-login')) != null ? _ref5 : loginState.quickLoginToRegister;
7506
7504
  const shouldNavigateToRegisterQuickLogin = __shouldNavigateToRegisterQuickLogin(user);
7507
7505
  actions.afterAuthenticationStateUpdate({
7508
7506
  user: updatedUser,
@@ -7511,7 +7509,7 @@ const _excluded = ["callback", "error"],
7511
7509
  }, {
7512
7510
  loginState: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, loginState, {
7513
7511
  quickLoginToRegister,
7514
- flow: shouldNavigateToRegisterQuickLogin ? _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.RegisterQuickLogin : _interfaces__WEBPACK_IMPORTED_MODULE_5__.LoginFlow.Login
7512
+ flow: shouldNavigateToRegisterQuickLogin ? _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.RegisterQuickLogin : _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.Login
7515
7513
  }),
7516
7514
  isAuthenticated: true
7517
7515
  });
@@ -20259,7 +20257,7 @@ __webpack_require__.r(__webpack_exports__);
20259
20257
  /* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
20260
20258
  /* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
20261
20259
  /* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
20262
- /** @license Frontegg v7.111.0-alpha.3
20260
+ /** @license Frontegg v7.111.0-alpha.4
20263
20261
  *
20264
20262
  * This source code is licensed under the MIT license found in the
20265
20263
  * LICENSE file in the root directory of this source tree.
@@ -30795,7 +30793,7 @@ __webpack_require__.r(__webpack_exports__);
30795
30793
  /* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
30796
30794
  /* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
30797
30795
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
30798
- /** @license Frontegg v7.111.0-alpha.3
30796
+ /** @license Frontegg v7.111.0-alpha.4
30799
30797
  *
30800
30798
  * This source code is licensed under the MIT license found in the
30801
30799
  * LICENSE file in the root directory of this source tree.
@@ -33592,7 +33590,7 @@ __webpack_require__.r(__webpack_exports__);
33592
33590
  /* harmony export */ });
33593
33591
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
33594
33592
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
33595
- /** @license Frontegg v7.111.0-alpha.3
33593
+ /** @license Frontegg v7.111.0-alpha.4
33596
33594
  *
33597
33595
  * This source code is licensed under the MIT license found in the
33598
33596
  * LICENSE file in the root directory of this source tree.