@frontegg/js 6.165.0-alpha.3 → 6.165.0-alpha.5

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.
@@ -563,7 +563,10 @@ export var FronteggApp = /*#__PURE__*/function () {
563
563
  stepUpUrl = _ref4.routes.stepUpUrl;
564
564
  if (hostedLoginBox) {
565
565
  this.store.dispatch({
566
- type: 'auth/stepUpHostedLogin'
566
+ type: 'auth/stepUpHostedLogin',
567
+ payload: {
568
+ options: options
569
+ }
567
570
  });
568
571
  return;
569
572
  }
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.165.0-alpha.3
1
+ /** @license Frontegg v6.165.0-alpha.5
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -570,7 +570,10 @@ var FronteggApp = /*#__PURE__*/function () {
570
570
  stepUpUrl = _ref4.routes.stepUpUrl;
571
571
  if (hostedLoginBox) {
572
572
  this.store.dispatch({
573
- type: 'auth/stepUpHostedLogin'
573
+ type: 'auth/stepUpHostedLogin',
574
+ payload: {
575
+ options: options
576
+ }
574
577
  });
575
578
  return;
576
579
  }
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.165.0-alpha.3
1
+ /** @license Frontegg v6.165.0-alpha.5
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/node/version.js CHANGED
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _default = {
8
- cdnVersion: '6.165.0-alpha.3'
8
+ cdnVersion: '6.165.0-alpha.5'
9
9
  };
10
10
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@frontegg/js",
3
- "version": "6.165.0-alpha.3",
3
+ "version": "6.165.0-alpha.5",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",
7
7
  "dependencies": {
8
8
  "@babel/runtime": "^7.18.6",
9
- "@frontegg/types": "6.165.0-alpha.3"
9
+ "@frontegg/types": "6.165.0-alpha.5"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [
@@ -884,7 +884,10 @@ var FronteggApp = /*#__PURE__*/function () {
884
884
  stepUpUrl = _ref4.routes.stepUpUrl;
885
885
  if (hostedLoginBox) {
886
886
  this.store.dispatch({
887
- type: 'auth/stepUpHostedLogin'
887
+ type: 'auth/stepUpHostedLogin',
888
+ payload: {
889
+ options: options
890
+ }
888
891
  });
889
892
  return;
890
893
  }
@@ -1452,7 +1455,7 @@ __webpack_require__.r(__webpack_exports__);
1452
1455
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1453
1456
  /* harmony export */ });
1454
1457
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1455
- cdnVersion: '6.165.0-alpha.3'
1458
+ cdnVersion: '6.165.0-alpha.5'
1456
1459
  });
1457
1460
 
1458
1461
  /***/ }),
@@ -5897,20 +5900,20 @@ __webpack_require__.r(__webpack_exports__);
5897
5900
  /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../interfaces */ "../../dist/@frontegg/redux-store/auth/interfaces.js");
5898
5901
  /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./interfaces */ "../../dist/@frontegg/redux-store/auth/LoginState/interfaces.js");
5899
5902
  /* harmony import */ var _sagas_mfaRequiredState_saga__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./sagas/mfaRequiredState.saga */ "../../dist/@frontegg/redux-store/auth/LoginState/sagas/mfaRequiredState.saga.js");
5900
- /* harmony import */ var _SignUp_saga__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../SignUp/saga */ "../../dist/@frontegg/redux-store/auth/SignUp/saga.js");
5903
+ /* harmony import */ var _SignUp_saga__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../SignUp/saga */ "../../dist/@frontegg/redux-store/auth/SignUp/saga.js");
5901
5904
  /* harmony import */ var _MfaState_interfaces__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../MfaState/interfaces */ "../../dist/@frontegg/redux-store/auth/MfaState/interfaces.js");
5902
5905
  /* harmony import */ var _dummy__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../dummy */ "../../dist/@frontegg/redux-store/auth/dummy.js");
5903
5906
  /* harmony import */ var _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../SSOState/interfaces */ "../../dist/@frontegg/redux-store/auth/SSOState/interfaces.js");
5904
- /* harmony import */ var _vendor_saga__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../vendor/saga */ "../../dist/@frontegg/redux-store/vendor/saga.js");
5907
+ /* harmony import */ var _vendor_saga__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../vendor/saga */ "../../dist/@frontegg/redux-store/vendor/saga.js");
5905
5908
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers.js");
5906
5909
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../utils */ "../../dist/@frontegg/redux-store/auth/utils.js");
5907
- /* harmony import */ var _Security_SecurityPolicyState_saga__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../Security/SecurityPolicyState/saga */ "../../dist/@frontegg/redux-store/auth/Security/SecurityPolicyState/saga.js");
5910
+ /* harmony import */ var _Security_SecurityPolicyState_saga__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../Security/SecurityPolicyState/saga */ "../../dist/@frontegg/redux-store/auth/Security/SecurityPolicyState/saga.js");
5908
5911
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ "../../dist/@frontegg/redux-store/auth/LoginState/utils.js");
5909
5912
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../utils */ "../../dist/@frontegg/redux-store/utils/errorHandler.js");
5910
5913
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../utils */ "../../dist/@frontegg/redux-store/utils/gtm.js");
5911
5914
  /* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./consts */ "../../dist/@frontegg/redux-store/auth/LoginState/consts.js");
5912
5915
  /* harmony import */ var _Entitlements__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Entitlements */ "../../dist/@frontegg/redux-store/auth/Entitlements/saga.js");
5913
- /* harmony import */ var _CustomLoginState_saga__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../CustomLoginState/saga */ "../../dist/@frontegg/redux-store/auth/CustomLoginState/saga.js");
5916
+ /* harmony import */ var _CustomLoginState_saga__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../CustomLoginState/saga */ "../../dist/@frontegg/redux-store/auth/CustomLoginState/saga.js");
5914
5917
  /* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../toolkit */ "../../dist/@frontegg/redux-store/toolkit/FronteggNativeModule.js");
5915
5918
  /* harmony import */ var _saga_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./saga.utils */ "../../dist/@frontegg/redux-store/auth/LoginState/saga.utils.js");
5916
5919
  /* harmony import */ var _sagas__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./sagas/afterAuthNavigation.saga */ "../../dist/@frontegg/redux-store/auth/LoginState/sagas/afterAuthNavigation.saga.js");
@@ -6269,30 +6272,29 @@ function* requestAuthorize({
6269
6272
  payload: firstTime
6270
6273
  }) {
6271
6274
  const calls = [];
6272
- const isCustomLoginEnabled = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_CustomLoginState_saga__WEBPACK_IMPORTED_MODULE_12__.customLoginEnabled);
6273
- if (isCustomLoginEnabled) {
6274
- /*
6275
- // waiting for refreshToken to be loaded is only necessary for custom login
6276
- // but doing this will degrade the loading performance in around 500 ms
6277
- // so we will wait for the refreshToken only if there is tenantResolver
6278
- */
6279
- yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(refreshToken);
6280
- } else {
6281
- calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(refreshToken));
6282
- }
6275
+ const callsAfterRefresh = [];
6276
+ calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(refreshToken));
6283
6277
  if (firstTime) {
6284
6278
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.put)(_reducer__WEBPACK_IMPORTED_MODULE_5__.actions.setState({
6285
6279
  isLoading: true
6286
6280
  }));
6287
6281
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.put)(_reducer__WEBPACK_IMPORTED_MODULE_5__.actions.loadSocialLoginsConfigurationV2());
6288
- calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_SignUp_saga__WEBPACK_IMPORTED_MODULE_13__.loadAllowSignUps));
6289
- calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_Security_SecurityPolicyState_saga__WEBPACK_IMPORTED_MODULE_14__.loadPublicAuthStrategiesPolicy));
6282
+ calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_SignUp_saga__WEBPACK_IMPORTED_MODULE_12__.loadAllowSignUps));
6283
+ calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_Security_SecurityPolicyState_saga__WEBPACK_IMPORTED_MODULE_13__.loadPublicAuthStrategiesPolicy));
6290
6284
  calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(loadSSOPublicConfigurationFunction));
6291
- calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_vendor_saga__WEBPACK_IMPORTED_MODULE_15__.loadVendorPublicInfo));
6285
+ calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_vendor_saga__WEBPACK_IMPORTED_MODULE_14__.loadVendorPublicInfo));
6292
6286
  calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(refreshMetadata));
6293
- calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_CustomLoginState_saga__WEBPACK_IMPORTED_MODULE_12__.loadCustomLoginRoutes));
6287
+ /*
6288
+ We will load custom login routes only if custom login is enabled
6289
+ In order to check if custom login is enabled without the tenant alias (search-param/sub-domain)
6290
+ we have to wait for the user state (refreshToken request)
6291
+ */
6292
+ callsAfterRefresh.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_CustomLoginState_saga__WEBPACK_IMPORTED_MODULE_15__.loadCustomLoginRoutes));
6294
6293
  }
6295
6294
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.all)(calls);
6295
+ if (callsAfterRefresh.length > 0) {
6296
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.all)(callsAfterRefresh);
6297
+ }
6296
6298
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.put)(_reducer__WEBPACK_IMPORTED_MODULE_5__.actions.setState({
6297
6299
  isLoading: false
6298
6300
  }));
@@ -6325,12 +6327,12 @@ function* requestAuthorizeSSR({
6325
6327
  }) {
6326
6328
  const calls = [];
6327
6329
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.put)(_reducer__WEBPACK_IMPORTED_MODULE_5__.actions.loadSocialLoginsConfigurationV2());
6328
- calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_SignUp_saga__WEBPACK_IMPORTED_MODULE_13__.loadAllowSignUps));
6330
+ calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_SignUp_saga__WEBPACK_IMPORTED_MODULE_12__.loadAllowSignUps));
6329
6331
  calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(loadSSOPublicConfigurationFunction));
6330
- calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_vendor_saga__WEBPACK_IMPORTED_MODULE_15__.loadVendorPublicInfo));
6332
+ calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_vendor_saga__WEBPACK_IMPORTED_MODULE_14__.loadVendorPublicInfo));
6331
6333
  calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(refreshMetadata));
6332
6334
  calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(isMFARequiredSSR, payload));
6333
- calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_CustomLoginState_saga__WEBPACK_IMPORTED_MODULE_12__.loadCustomLoginRoutes));
6335
+ calls.push((0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_CustomLoginState_saga__WEBPACK_IMPORTED_MODULE_15__.loadCustomLoginRoutes));
6334
6336
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.all)(calls);
6335
6337
  }
6336
6338
  const getUri = urlStrategy => {
@@ -6458,7 +6460,7 @@ function* requestHostedLoginAuthorize(additionalParams) {
6458
6460
  // We are saving the verifier in session storage to be able to validate the response
6459
6461
  localStorage.setItem(_constants__WEBPACK_IMPORTED_MODULE_17__.HOSTED_LOGIN_VERIFIER_KEY, code_verifier);
6460
6462
  let redirectUrl = `${window.location.origin}${urlStrategy === 'path' ? '' : '#'}${routes.hostedLoginRedirectUrl}`;
6461
- yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_CustomLoginState_saga__WEBPACK_IMPORTED_MODULE_12__.loadCustomLoginRoutes);
6463
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_CustomLoginState_saga__WEBPACK_IMPORTED_MODULE_15__.loadCustomLoginRoutes);
6462
6464
  const customLoginSearchParam = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.select)(state => {
6463
6465
  var _state$auth$customLog;
6464
6466
  return (_state$auth$customLog = state.auth.customLoginState) == null ? void 0 : _state$auth$customLog.customLoginSearchParams;
@@ -6511,7 +6513,7 @@ function* handleHostedLoginCallback({
6511
6513
  urlStrategy: state.root.urlStrategy
6512
6514
  }));
6513
6515
  let redirectUrl = `${window.location.origin}${urlStrategy === 'path' ? '' : '#'}${routes.hostedLoginRedirectUrl}`;
6514
- yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_CustomLoginState_saga__WEBPACK_IMPORTED_MODULE_12__.loadCustomLoginRoutes);
6516
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_CustomLoginState_saga__WEBPACK_IMPORTED_MODULE_15__.loadCustomLoginRoutes);
6515
6517
  const customLoginSearchParam = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.select)(state => {
6516
6518
  var _state$auth$customLog2;
6517
6519
  return (_state$auth$customLog2 = state.auth.customLoginState) == null ? void 0 : _state$auth$customLog2.customLoginSearchParams;
@@ -16731,7 +16733,6 @@ __webpack_require__.r(__webpack_exports__);
16731
16733
  /**
16732
16734
  * Step up for hosted login apps
16733
16735
  * @param payload.maxAge
16734
- * @param payload.callback
16735
16736
  */
16736
16737
  function* stepUpHostedLogin({
16737
16738
  payload
@@ -24700,7 +24701,7 @@ __webpack_require__.r(__webpack_exports__);
24700
24701
  /* harmony export */ });
24701
24702
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
24702
24703
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
24703
- /** @license Frontegg v6.165.0-alpha.3
24704
+ /** @license Frontegg v6.165.0-alpha.5
24704
24705
  *
24705
24706
  * This source code is licensed under the MIT license found in the
24706
24707
  * LICENSE file in the root directory of this source tree.