@frontegg/js 6.165.0-alpha.10 → 6.165.0-alpha.12

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.
@@ -1,4 +1,4 @@
1
- import { EnhancedStore, EntitledToOptions, Entitlement } from '@frontegg/redux-store';
1
+ import { EnhancedStore, EntitledToOptions, Entitlement, StepUpOptions, IsSteppedUpOptions } from '@frontegg/redux-store';
2
2
  import { FronteggAppOptions, FronteggCheckoutDialogOptions, LocalizationsOverrides, LoadEntitlementsCallback } from '@frontegg/types';
3
3
  import { IFeatureFlagsAttributes } from '@frontegg/rest-api';
4
4
  import { CustomAttributes } from '@frontegg/entitlements-javascript-commons';
@@ -107,6 +107,16 @@ export declare class FronteggApp {
107
107
  * @param callback called on request completed with true if succeeded, false if failed
108
108
  */
109
109
  loadEntitlements(callback?: LoadEntitlementsCallback): void;
110
+ /**
111
+ * Redirects to the step up page with the max age param and set the redirect url in the local storage
112
+ * @param options.maxAge optional max age
113
+ */
114
+ stepUp(options?: StepUpOptions): void;
115
+ /**
116
+ * @param options.maxAge optional max age
117
+ * @return true when user is stepped up, false otherwise
118
+ */
119
+ isSteppedUp(options?: IsSteppedUpOptions): boolean;
110
120
  close(): void;
111
121
  }
112
122
  export {};
@@ -4,7 +4,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
4
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
5
5
  import _createClass from "@babel/runtime/helpers/esm/createClass";
6
6
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
- import { createFronteggStore, getPermissionEntitlements as _getPermissionEntitlements, getFeatureEntitlements as _getFeatureEntitlements } from '@frontegg/redux-store';
7
+ import { createFronteggStore, getPermissionEntitlements as _getPermissionEntitlements, getFeatureEntitlements as _getFeatureEntitlements, redirectByStepUpUrl, isSteppedUp as _isSteppedUp } from '@frontegg/redux-store';
8
8
  import { Metadata } from '@frontegg/types';
9
9
  import { formatName, restoreSearchParams } from '../utils';
10
10
  import { AppHolder } from '../AppHolder';
@@ -549,6 +549,41 @@ export var FronteggApp = /*#__PURE__*/function () {
549
549
  }
550
550
  });
551
551
  }
552
+
553
+ /**
554
+ * Redirects to the step up page with the max age param and set the redirect url in the local storage
555
+ * @param options.maxAge optional max age
556
+ */
557
+ }, {
558
+ key: "stepUp",
559
+ value: function stepUp(options) {
560
+ var state = this.store.getState();
561
+ var _ref4 = (state == null ? void 0 : state.auth) || {},
562
+ hostedLoginBox = _ref4.hostedLoginBox,
563
+ stepUpUrl = _ref4.routes.stepUpUrl;
564
+ if (hostedLoginBox) {
565
+ this.store.dispatch({
566
+ type: 'auth/stepUpHostedLogin',
567
+ payload: options
568
+ });
569
+ return;
570
+ }
571
+ redirectByStepUpUrl(stepUpUrl, state.auth.onRedirectTo, options == null ? void 0 : options.maxAge);
572
+ }
573
+
574
+ /**
575
+ * @param options.maxAge optional max age
576
+ * @return true when user is stepped up, false otherwise
577
+ */
578
+ }, {
579
+ key: "isSteppedUp",
580
+ value: function isSteppedUp() {
581
+ var _this$store$getState;
582
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
583
+ var _ref5 = ((_this$store$getState = this.store.getState()) == null ? void 0 : _this$store$getState.auth) || {},
584
+ user = _ref5.user;
585
+ return _isSteppedUp(user, options);
586
+ }
552
587
  }, {
553
588
  key: "close",
554
589
  value: function close() {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.165.0-alpha.10
1
+ /** @license Frontegg v6.165.0-alpha.12
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.
@@ -556,6 +556,41 @@ var FronteggApp = /*#__PURE__*/function () {
556
556
  }
557
557
  });
558
558
  }
559
+
560
+ /**
561
+ * Redirects to the step up page with the max age param and set the redirect url in the local storage
562
+ * @param options.maxAge optional max age
563
+ */
564
+ }, {
565
+ key: "stepUp",
566
+ value: function stepUp(options) {
567
+ var state = this.store.getState();
568
+ var _ref4 = (state == null ? void 0 : state.auth) || {},
569
+ hostedLoginBox = _ref4.hostedLoginBox,
570
+ stepUpUrl = _ref4.routes.stepUpUrl;
571
+ if (hostedLoginBox) {
572
+ this.store.dispatch({
573
+ type: 'auth/stepUpHostedLogin',
574
+ payload: options
575
+ });
576
+ return;
577
+ }
578
+ (0, _reduxStore.redirectByStepUpUrl)(stepUpUrl, state.auth.onRedirectTo, options == null ? void 0 : options.maxAge);
579
+ }
580
+
581
+ /**
582
+ * @param options.maxAge optional max age
583
+ * @return true when user is stepped up, false otherwise
584
+ */
585
+ }, {
586
+ key: "isSteppedUp",
587
+ value: function isSteppedUp() {
588
+ var _this$store$getState;
589
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
590
+ var _ref5 = ((_this$store$getState = this.store.getState()) == null ? void 0 : _this$store$getState.auth) || {},
591
+ user = _ref5.user;
592
+ return (0, _reduxStore.isSteppedUp)(user, options);
593
+ }
559
594
  }, {
560
595
  key: "close",
561
596
  value: function close() {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.165.0-alpha.10
1
+ /** @license Frontegg v6.165.0-alpha.12
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.10'
8
+ cdnVersion: '6.165.0-alpha.12'
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.10",
3
+ "version": "6.165.0-alpha.12",
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.10"
9
+ "@frontegg/types": "6.165.0-alpha.12"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [
@@ -303,6 +303,7 @@ __webpack_require__.r(__webpack_exports__);
303
303
  /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__);
304
304
  /* harmony import */ var _frontegg_redux_store__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @frontegg/redux-store */ "../../dist/@frontegg/redux-store/toolkit/index.js");
305
305
  /* harmony import */ var _frontegg_redux_store__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @frontegg/redux-store */ "../../dist/@frontegg/redux-store/auth/Entitlements/utils.js");
306
+ /* harmony import */ var _frontegg_redux_store__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @frontegg/redux-store */ "../../dist/@frontegg/redux-store/auth/StepUpState/utils.js");
306
307
  /* harmony import */ var _frontegg_types__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @frontegg/types */ "../../dist/@frontegg/types/Metadata/index.js");
307
308
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils */ "../../dist/@frontegg/js/utils/index.js");
308
309
  /* harmony import */ var _AppHolder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../AppHolder */ "../../dist/@frontegg/js/AppHolder/index.js");
@@ -869,6 +870,41 @@ var FronteggApp = /*#__PURE__*/function () {
869
870
  }
870
871
  });
871
872
  }
873
+
874
+ /**
875
+ * Redirects to the step up page with the max age param and set the redirect url in the local storage
876
+ * @param options.maxAge optional max age
877
+ */
878
+ }, {
879
+ key: "stepUp",
880
+ value: function stepUp(options) {
881
+ var state = this.store.getState();
882
+ var _ref4 = (state == null ? void 0 : state.auth) || {},
883
+ hostedLoginBox = _ref4.hostedLoginBox,
884
+ stepUpUrl = _ref4.routes.stepUpUrl;
885
+ if (hostedLoginBox) {
886
+ this.store.dispatch({
887
+ type: 'auth/stepUpHostedLogin',
888
+ payload: options
889
+ });
890
+ return;
891
+ }
892
+ (0,_frontegg_redux_store__WEBPACK_IMPORTED_MODULE_21__.redirectByStepUpUrl)(stepUpUrl, state.auth.onRedirectTo, options == null ? void 0 : options.maxAge);
893
+ }
894
+
895
+ /**
896
+ * @param options.maxAge optional max age
897
+ * @return true when user is stepped up, false otherwise
898
+ */
899
+ }, {
900
+ key: "isSteppedUp",
901
+ value: function isSteppedUp() {
902
+ var _this$store$getState;
903
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
904
+ var _ref5 = ((_this$store$getState = this.store.getState()) == null ? void 0 : _this$store$getState.auth) || {},
905
+ user = _ref5.user;
906
+ return (0,_frontegg_redux_store__WEBPACK_IMPORTED_MODULE_21__.isSteppedUp)(user, options);
907
+ }
872
908
  }, {
873
909
  key: "close",
874
910
  value: function close() {
@@ -1417,7 +1453,7 @@ __webpack_require__.r(__webpack_exports__);
1417
1453
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1418
1454
  /* harmony export */ });
1419
1455
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1420
- cdnVersion: '6.165.0-alpha.10'
1456
+ cdnVersion: '6.165.0-alpha.12'
1421
1457
  });
1422
1458
 
1423
1459
  /***/ }),
@@ -5614,6 +5650,7 @@ const defaultFronteggRoutes = {
5614
5650
  "use strict";
5615
5651
  __webpack_require__.r(__webpack_exports__);
5616
5652
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5653
+ /* harmony export */ "defaultFronteggRoutes": () => (/* reexport safe */ _consts__WEBPACK_IMPORTED_MODULE_5__.defaultFronteggRoutes),
5617
5654
  /* harmony export */ "getRedirectUrl": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_4__.getRedirectUrl),
5618
5655
  /* harmony export */ "getSearchParam": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_4__.getSearchParam),
5619
5656
  /* harmony export */ "loginActions": () => (/* binding */ actions),
@@ -5625,6 +5662,7 @@ __webpack_require__.r(__webpack_exports__);
5625
5662
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "../../dist/@frontegg/redux-store/auth/utils.js");
5626
5663
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants */ "../../dist/@frontegg/redux-store/constants.js");
5627
5664
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "../../dist/@frontegg/redux-store/auth/LoginState/utils.js");
5665
+ /* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./consts */ "../../dist/@frontegg/redux-store/auth/LoginState/consts.js");
5628
5666
 
5629
5667
 
5630
5668
 
@@ -5768,6 +5806,7 @@ const Matcher = {};
5768
5806
 
5769
5807
 
5770
5808
 
5809
+
5771
5810
  /***/ }),
5772
5811
 
5773
5812
  /***/ "../../dist/@frontegg/redux-store/auth/LoginState/interfaces.js":
@@ -5843,7 +5882,8 @@ __webpack_require__.r(__webpack_exports__);
5843
5882
  /* harmony export */ "mfaWithAuthenticator": () => (/* reexport safe */ _sagas__WEBPACK_IMPORTED_MODULE_29__.mfaWithAuthenticator),
5844
5883
  /* harmony export */ "refreshMetadata": () => (/* binding */ refreshMetadata),
5845
5884
  /* harmony export */ "refreshToken": () => (/* binding */ refreshToken),
5846
- /* harmony export */ "refreshTokenForSocialLogins": () => (/* binding */ refreshTokenForSocialLogins)
5885
+ /* harmony export */ "refreshTokenForSocialLogins": () => (/* binding */ refreshTokenForSocialLogins),
5886
+ /* harmony export */ "requestHostedLoginAuthorize": () => (/* binding */ requestHostedLoginAuthorize)
5847
5887
  /* harmony export */ });
5848
5888
  /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
5849
5889
  /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "../../node_modules/@babel/runtime/helpers/esm/extends.js");
@@ -16295,7 +16335,8 @@ __webpack_require__.r(__webpack_exports__);
16295
16335
  /* harmony export */ "ACR_VALUE": () => (/* binding */ ACR_VALUE),
16296
16336
  /* harmony export */ "AMR_ADDITIONAL_VALUE": () => (/* binding */ AMR_ADDITIONAL_VALUE),
16297
16337
  /* harmony export */ "AMR_MFA_VALUE": () => (/* binding */ AMR_MFA_VALUE),
16298
- /* harmony export */ "SHOULD_STEP_UP_KEY": () => (/* binding */ SHOULD_STEP_UP_KEY)
16338
+ /* harmony export */ "SHOULD_STEP_UP_KEY": () => (/* binding */ SHOULD_STEP_UP_KEY),
16339
+ /* harmony export */ "STEP_UP_MAX_AGE_PARAM_NAME": () => (/* binding */ STEP_UP_MAX_AGE_PARAM_NAME)
16299
16340
  /* harmony export */ });
16300
16341
  /**
16301
16342
  * The required ACR (Authorization Context Reference) value for the step up flow
@@ -16318,6 +16359,11 @@ const AMR_ADDITIONAL_VALUE = ['otp', 'sms', 'hwk'];
16318
16359
  */
16319
16360
  const SHOULD_STEP_UP_KEY = 'SHOULD_STEP_UP';
16320
16361
 
16362
+ /**
16363
+ * The name of the query param that contains the max age of the step up
16364
+ */
16365
+ const STEP_UP_MAX_AGE_PARAM_NAME = 'maxAge';
16366
+
16321
16367
  /***/ }),
16322
16368
 
16323
16369
  /***/ "../../dist/@frontegg/redux-store/auth/StepUpState/generateStepUpSession.saga.js":
@@ -16455,7 +16501,10 @@ function* generateStepUpSession({
16455
16501
  "use strict";
16456
16502
  __webpack_require__.r(__webpack_exports__);
16457
16503
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16504
+ /* harmony export */ "STEP_UP_MAX_AGE_PARAM_NAME": () => (/* reexport safe */ _consts__WEBPACK_IMPORTED_MODULE_4__.STEP_UP_MAX_AGE_PARAM_NAME),
16458
16505
  /* harmony export */ "isSteppedUp": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.isSteppedUp),
16506
+ /* harmony export */ "redirectByStepUpUrl": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.redirectByStepUpUrl),
16507
+ /* harmony export */ "setAfterAuthRedirectUrlForStepUp": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_3__.setAfterAuthRedirectUrlForStepUp),
16459
16508
  /* harmony export */ "stepUpActions": () => (/* binding */ actions),
16460
16509
  /* harmony export */ "stepUpReducers": () => (/* binding */ reducers),
16461
16510
  /* harmony export */ "stepUpState": () => (/* binding */ stepUpState)
@@ -16464,6 +16513,7 @@ __webpack_require__.r(__webpack_exports__);
16464
16513
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "../../dist/@frontegg/redux-store/auth/utils.js");
16465
16514
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants */ "../../dist/@frontegg/redux-store/constants.js");
16466
16515
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "../../dist/@frontegg/redux-store/auth/StepUpState/utils.js");
16516
+ /* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./consts */ "../../dist/@frontegg/redux-store/auth/StepUpState/consts.js");
16467
16517
 
16468
16518
 
16469
16519
 
@@ -16479,6 +16529,9 @@ const reducers = {
16479
16529
  })
16480
16530
  };
16481
16531
  const actions = {
16532
+ stepUpHostedLogin: (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__.createAction)(`${_constants__WEBPACK_IMPORTED_MODULE_2__.authStoreName}/stepUpHostedLogin`, payload => ({
16533
+ payload
16534
+ })),
16482
16535
  generateStepUpSession: (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__.createAction)(`${_constants__WEBPACK_IMPORTED_MODULE_2__.authStoreName}/generateStepUpSession`, payload => ({
16483
16536
  payload
16484
16537
  })),
@@ -16519,6 +16572,7 @@ const Matcher = {};
16519
16572
 
16520
16573
 
16521
16574
 
16575
+
16522
16576
  /***/ }),
16523
16577
 
16524
16578
  /***/ "../../dist/@frontegg/redux-store/auth/StepUpState/saga.js":
@@ -16545,7 +16599,9 @@ __webpack_require__.r(__webpack_exports__);
16545
16599
  /* harmony import */ var _LoginState_sagas_mfaWithSMS_saga__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../LoginState/sagas/mfaWithSMS.saga */ "../../dist/@frontegg/redux-store/auth/LoginState/sagas/mfaWithSMS.saga.js");
16546
16600
  /* harmony import */ var _LoginState_sagas_mfaWithWebAuthn_saga__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../LoginState/sagas/mfaWithWebAuthn.saga */ "../../dist/@frontegg/redux-store/auth/LoginState/sagas/mfaWithWebAuthn.saga.js");
16547
16601
  /* harmony import */ var _LoginState_sagas_mfaWithEmailCode_saga__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../LoginState/sagas/mfaWithEmailCode.saga */ "../../dist/@frontegg/redux-store/auth/LoginState/sagas/mfaWithEmailCode.saga.js");
16548
- /* harmony import */ var _generateStepUpSession_saga__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./generateStepUpSession.saga */ "../../dist/@frontegg/redux-store/auth/StepUpState/generateStepUpSession.saga.js");
16602
+ /* harmony import */ var _generateStepUpSession_saga__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./generateStepUpSession.saga */ "../../dist/@frontegg/redux-store/auth/StepUpState/generateStepUpSession.saga.js");
16603
+ /* harmony import */ var _stepUpHostedLogin_saga__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./stepUpHostedLogin.saga */ "../../dist/@frontegg/redux-store/auth/StepUpState/stepUpHostedLogin.saga.js");
16604
+
16549
16605
 
16550
16606
 
16551
16607
 
@@ -16641,7 +16697,8 @@ function* preVerifyMFAEmailCodeForStepUp({
16641
16697
  yield (0,_LoginState_sagas_mfaWithEmailCode_saga__WEBPACK_IMPORTED_MODULE_5__.preVerifyMFAEmailCode)(payload, _reducer__WEBPACK_IMPORTED_MODULE_2__.actions.setStepUpState);
16642
16698
  }
16643
16699
  function* stepUpSagas() {
16644
- yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_0__.takeLeading)(_reducer__WEBPACK_IMPORTED_MODULE_2__.actions.generateStepUpSession, _generateStepUpSession_saga__WEBPACK_IMPORTED_MODULE_6__.generateStepUpSession);
16700
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_0__.takeLeading)(_reducer__WEBPACK_IMPORTED_MODULE_2__.actions.stepUpHostedLogin, _stepUpHostedLogin_saga__WEBPACK_IMPORTED_MODULE_6__.stepUpHostedLogin);
16701
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_0__.takeLeading)(_reducer__WEBPACK_IMPORTED_MODULE_2__.actions.generateStepUpSession, _generateStepUpSession_saga__WEBPACK_IMPORTED_MODULE_7__.generateStepUpSession);
16645
16702
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_0__.takeLeading)(_reducer__WEBPACK_IMPORTED_MODULE_2__.actions.stepUpWithAuthenticator, stepUpWithAuthenticator);
16646
16703
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_0__.takeLeading)(_reducer__WEBPACK_IMPORTED_MODULE_2__.actions.preVerifyMFASMSForStepUp, preVerifyMFASMSForStepUp);
16647
16704
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_0__.takeLeading)(_reducer__WEBPACK_IMPORTED_MODULE_2__.actions.verifyMFASMSForStepUp, verifyMFASMSForStepUp);
@@ -16653,6 +16710,46 @@ function* stepUpSagas() {
16653
16710
 
16654
16711
  /***/ }),
16655
16712
 
16713
+ /***/ "../../dist/@frontegg/redux-store/auth/StepUpState/stepUpHostedLogin.saga.js":
16714
+ /*!***********************************************************************************!*\
16715
+ !*** ../../dist/@frontegg/redux-store/auth/StepUpState/stepUpHostedLogin.saga.js ***!
16716
+ \***********************************************************************************/
16717
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16718
+
16719
+ "use strict";
16720
+ __webpack_require__.r(__webpack_exports__);
16721
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16722
+ /* harmony export */ "stepUpHostedLogin": () => (/* binding */ stepUpHostedLogin)
16723
+ /* harmony export */ });
16724
+ /* harmony import */ var _LoginState_saga__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../LoginState/saga */ "../../dist/@frontegg/redux-store/auth/LoginState/saga.js");
16725
+ /* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./consts */ "../../dist/@frontegg/redux-store/auth/StepUpState/consts.js");
16726
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "../../dist/@frontegg/redux-store/auth/StepUpState/utils.js");
16727
+
16728
+
16729
+
16730
+
16731
+ /**
16732
+ * Step up for hosted login apps
16733
+ * @param payload.maxAge
16734
+ */
16735
+ function* stepUpHostedLogin({
16736
+ payload
16737
+ }) {
16738
+ const params = {
16739
+ acr_values: _consts__WEBPACK_IMPORTED_MODULE_0__.ACR_VALUE
16740
+ };
16741
+ const {
16742
+ maxAge
16743
+ } = payload || {};
16744
+ if (maxAge !== undefined) {
16745
+ params.max_age = maxAge.toString();
16746
+ }
16747
+ (0,_utils__WEBPACK_IMPORTED_MODULE_1__.setAfterAuthRedirectUrlForStepUp)();
16748
+ yield (0,_LoginState_saga__WEBPACK_IMPORTED_MODULE_2__.requestHostedLoginAuthorize)(params);
16749
+ }
16750
+
16751
+ /***/ }),
16752
+
16656
16753
  /***/ "../../dist/@frontegg/redux-store/auth/StepUpState/utils.js":
16657
16754
  /*!******************************************************************!*\
16658
16755
  !*** ../../dist/@frontegg/redux-store/auth/StepUpState/utils.js ***!
@@ -16662,10 +16759,14 @@ function* stepUpSagas() {
16662
16759
  "use strict";
16663
16760
  __webpack_require__.r(__webpack_exports__);
16664
16761
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16665
- /* harmony export */ "isSteppedUp": () => (/* binding */ isSteppedUp)
16762
+ /* harmony export */ "isSteppedUp": () => (/* binding */ isSteppedUp),
16763
+ /* harmony export */ "redirectByStepUpUrl": () => (/* binding */ redirectByStepUpUrl),
16764
+ /* harmony export */ "setAfterAuthRedirectUrlForStepUp": () => (/* binding */ setAfterAuthRedirectUrlForStepUp)
16666
16765
  /* harmony export */ });
16766
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../constants */ "../../dist/@frontegg/redux-store/constants.js");
16667
16767
  /* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./consts */ "../../dist/@frontegg/redux-store/auth/StepUpState/consts.js");
16668
16768
 
16769
+
16669
16770
  /**
16670
16771
  * @param options.amr
16671
16772
  * @param options.acr
@@ -16673,12 +16774,15 @@ __webpack_require__.r(__webpack_exports__);
16673
16774
  * @param options.maxAge - max age of step up
16674
16775
  * @returns true when the user is stepped up, false otherwise
16675
16776
  */
16676
- const isSteppedUp = ({
16677
- amr = [],
16678
- acr = '',
16679
- auth_time,
16777
+ const isSteppedUp = (user, {
16680
16778
  maxAge
16681
16779
  } = {}) => {
16780
+ if (!user) return false;
16781
+ const {
16782
+ amr = [],
16783
+ acr = '',
16784
+ auth_time
16785
+ } = user;
16682
16786
  if (maxAge && auth_time) {
16683
16787
  // when user is logged in for a long time (more than maxAge, but jwt is still valid because it's not refreshed yet)
16684
16788
  const isMaxAgeValid = Date.now() / 1000 - auth_time <= maxAge;
@@ -16690,6 +16794,29 @@ const isSteppedUp = ({
16690
16794
  return isACRValid && isAMRIncludesMFA && isAMRIncludesMethod;
16691
16795
  };
16692
16796
 
16797
+ /**
16798
+ * Set the url and query params in the local storage FRONTEGG_AFTER_AUTH_REDIRECT_URL value
16799
+ */
16800
+ function setAfterAuthRedirectUrlForStepUp() {
16801
+ const encodedRedirectUrl = window.location.pathname + window.location.search;
16802
+ window.localStorage.setItem(_constants__WEBPACK_IMPORTED_MODULE_1__.FRONTEGG_AFTER_AUTH_REDIRECT_URL, encodedRedirectUrl);
16803
+ }
16804
+
16805
+ /**
16806
+ * Redirects to the step up url with the max age param and set the redirect url in the local storage
16807
+ * The redirect url will be used after the step up flow is done
16808
+ * @param stepUpUrl - step up url to redirect to
16809
+ * @param onRedirectTo - redirect to function
16810
+ * @param maxAge - max age of step up
16811
+ */
16812
+ const redirectByStepUpUrl = (stepUpUrl, onRedirectTo, maxAge) => {
16813
+ setAfterAuthRedirectUrlForStepUp();
16814
+ const maxAgePart = maxAge !== undefined ? `?${_consts__WEBPACK_IMPORTED_MODULE_0__.STEP_UP_MAX_AGE_PARAM_NAME}=${maxAge}` : '';
16815
+ onRedirectTo(`${stepUpUrl}${maxAgePart}`, {
16816
+ refresh: false
16817
+ });
16818
+ };
16819
+
16693
16820
  /***/ }),
16694
16821
 
16695
16822
  /***/ "../../dist/@frontegg/redux-store/auth/TeamState/index.js":
@@ -19222,6 +19349,7 @@ __webpack_require__.r(__webpack_exports__);
19222
19349
  /* harmony export */ "QuickLoginStrategy": () => (/* reexport safe */ _LoginState_interfaces__WEBPACK_IMPORTED_MODULE_1__.QuickLoginStrategy),
19223
19350
  /* harmony export */ "ResetPhoneNumberStep": () => (/* reexport safe */ _ResetPhoneNumberState_interfaces__WEBPACK_IMPORTED_MODULE_12__.ResetPhoneNumberStep),
19224
19351
  /* harmony export */ "SSOStateKeys": () => (/* reexport safe */ _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_14__.SSOStateKeys),
19352
+ /* harmony export */ "STEP_UP_MAX_AGE_PARAM_NAME": () => (/* reexport safe */ _StepUpState__WEBPACK_IMPORTED_MODULE_3__.STEP_UP_MAX_AGE_PARAM_NAME),
19225
19353
  /* harmony export */ "SamlVendors": () => (/* reexport safe */ _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_14__.SamlVendors),
19226
19354
  /* harmony export */ "SecurityCenterStateKeys": () => (/* reexport safe */ _Security_SecurityCenterState_types__WEBPACK_IMPORTED_MODULE_41__.SecurityCenterStateKeys),
19227
19355
  /* harmony export */ "SignUpStage": () => (/* reexport safe */ _SignUp_interfaces__WEBPACK_IMPORTED_MODULE_25__.SignUpStage),
@@ -19256,6 +19384,7 @@ __webpack_require__.r(__webpack_exports__);
19256
19384
  /* harmony export */ "customLoginReducers": () => (/* reexport safe */ _CustomLoginState__WEBPACK_IMPORTED_MODULE_42__.customLoginReducers),
19257
19385
  /* harmony export */ "customLoginState": () => (/* reexport safe */ _CustomLoginState__WEBPACK_IMPORTED_MODULE_42__.customLoginState),
19258
19386
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
19387
+ /* harmony export */ "defaultFronteggRoutes": () => (/* reexport safe */ _LoginState__WEBPACK_IMPORTED_MODULE_2__.defaultFronteggRoutes),
19259
19388
  /* harmony export */ "entitlementsSagas": () => (/* reexport safe */ _Entitlements__WEBPACK_IMPORTED_MODULE_37__.entitlementsSagas),
19260
19389
  /* harmony export */ "forgotPasswordActions": () => (/* reexport safe */ _ForgotPasswordState__WEBPACK_IMPORTED_MODULE_11__.forgotPasswordActions),
19261
19390
  /* harmony export */ "forgotPasswordReducers": () => (/* reexport safe */ _ForgotPasswordState__WEBPACK_IMPORTED_MODULE_11__.forgotPasswordReducers),
@@ -19294,6 +19423,7 @@ __webpack_require__.r(__webpack_exports__);
19294
19423
  /* harmony export */ "provisioningActions": () => (/* reexport safe */ _Provisioning__WEBPACK_IMPORTED_MODULE_36__.provisioningActions),
19295
19424
  /* harmony export */ "provisioningReducers": () => (/* reexport safe */ _Provisioning__WEBPACK_IMPORTED_MODULE_36__.provisioningReducers),
19296
19425
  /* harmony export */ "provisioningState": () => (/* reexport safe */ _Provisioning__WEBPACK_IMPORTED_MODULE_36__.provisioningState),
19426
+ /* harmony export */ "redirectByStepUpUrl": () => (/* reexport safe */ _StepUpState__WEBPACK_IMPORTED_MODULE_3__.redirectByStepUpUrl),
19297
19427
  /* harmony export */ "resetPhoneNumberActions": () => (/* reexport safe */ _ResetPhoneNumberState__WEBPACK_IMPORTED_MODULE_13__.resetPhoneNumberActions),
19298
19428
  /* harmony export */ "resetPhoneNumberReducers": () => (/* reexport safe */ _ResetPhoneNumberState__WEBPACK_IMPORTED_MODULE_13__.resetPhoneNumberReducers),
19299
19429
  /* harmony export */ "resetPhoneNumberState": () => (/* reexport safe */ _ResetPhoneNumberState__WEBPACK_IMPORTED_MODULE_13__.resetPhoneNumberState),
@@ -19315,6 +19445,7 @@ __webpack_require__.r(__webpack_exports__);
19315
19445
  /* harmony export */ "sessionsPolicyState": () => (/* reexport safe */ _Security_SessionsPolicyState__WEBPACK_IMPORTED_MODULE_34__.sessionsPolicyState),
19316
19446
  /* harmony export */ "sessionsReducers": () => (/* reexport safe */ _SessionsState__WEBPACK_IMPORTED_MODULE_33__.sessionsReducers),
19317
19447
  /* harmony export */ "sessionsState": () => (/* reexport safe */ _SessionsState__WEBPACK_IMPORTED_MODULE_33__.sessionsState),
19448
+ /* harmony export */ "setAfterAuthRedirectUrlForStepUp": () => (/* reexport safe */ _StepUpState__WEBPACK_IMPORTED_MODULE_3__.setAfterAuthRedirectUrlForStepUp),
19318
19449
  /* harmony export */ "signUpActions": () => (/* reexport safe */ _SignUp__WEBPACK_IMPORTED_MODULE_26__.signUpActions),
19319
19450
  /* harmony export */ "signUpReducers": () => (/* reexport safe */ _SignUp__WEBPACK_IMPORTED_MODULE_26__.signUpReducers),
19320
19451
  /* harmony export */ "signUpState": () => (/* reexport safe */ _SignUp__WEBPACK_IMPORTED_MODULE_26__.signUpState),
@@ -24568,7 +24699,7 @@ __webpack_require__.r(__webpack_exports__);
24568
24699
  /* harmony export */ });
24569
24700
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
24570
24701
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
24571
- /** @license Frontegg v6.165.0-alpha.10
24702
+ /** @license Frontegg v6.165.0-alpha.12
24572
24703
  *
24573
24704
  * This source code is licensed under the MIT license found in the
24574
24705
  * LICENSE file in the root directory of this source tree.