@frontegg/js 7.53.0 → 7.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.53.0
1
+ /** @license Frontegg v7.54.0
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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.53.0
1
+ /** @license Frontegg v7.54.0
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: '7.53.0'
8
+ cdnVersion: '7.54.0'
9
9
  };
10
10
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@frontegg/js",
3
- "version": "7.53.0",
3
+ "version": "7.54.0",
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": "7.53.0"
9
+ "@frontegg/types": "7.54.0"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [
@@ -1620,7 +1620,7 @@ __webpack_require__.r(__webpack_exports__);
1620
1620
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1621
1621
  /* harmony export */ });
1622
1622
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1623
- cdnVersion: '7.53.0'
1623
+ cdnVersion: '7.54.0'
1624
1624
  });
1625
1625
 
1626
1626
  /***/ }),
@@ -2596,7 +2596,8 @@ const _excluded = ["user"],
2596
2596
  } = _payload,
2597
2597
  payload = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_payload, _excluded2);
2598
2598
  setActivateState({
2599
- loading: true
2599
+ loading: true,
2600
+ submitting: true
2600
2601
  });
2601
2602
  try {
2602
2603
  const onRedirectTo = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_9__.ContextHolder.for(store.root.appName).onRedirectTo;
@@ -2606,6 +2607,9 @@ const _excluded = ["user"],
2606
2607
  user
2607
2608
  } = _await$api$auth$activ,
2608
2609
  rest = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_await$api$auth$activ, _excluded3);
2610
+ setActivateState({
2611
+ submitting: false
2612
+ });
2609
2613
  await handleActivationResponse({
2610
2614
  loginResponse: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
2611
2615
  user
@@ -2629,7 +2633,8 @@ const _excluded = ["user"],
2629
2633
  } = _payload,
2630
2634
  payload = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_payload, _excluded4);
2631
2635
  setActivateState({
2632
- loading: true
2636
+ loading: true,
2637
+ submitting: true
2633
2638
  });
2634
2639
  try {
2635
2640
  const onRedirectTo = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_9__.ContextHolder.for(store.root.appName).onRedirectTo;
@@ -2639,6 +2644,9 @@ const _excluded = ["user"],
2639
2644
  user
2640
2645
  } = _await$api$auth$activ2,
2641
2646
  rest = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_await$api$auth$activ2, _excluded5);
2647
+ setActivateState({
2648
+ submitting: false
2649
+ });
2642
2650
  await handleActivationResponse({
2643
2651
  loginResponse: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
2644
2652
  user
@@ -2766,6 +2774,7 @@ __webpack_require__.r(__webpack_exports__);
2766
2774
  const initialState = {
2767
2775
  step: _interfaces__WEBPACK_IMPORTED_MODULE_0__.ActivateAccountStep.activating,
2768
2776
  loading: false,
2777
+ submitting: false,
2769
2778
  resentEmail: false,
2770
2779
  activationStrategy: {
2771
2780
  loading: false
@@ -4806,10 +4815,11 @@ __webpack_require__.r(__webpack_exports__);
4806
4815
  loginUrl,
4807
4816
  logoutUrl,
4808
4817
  socialLoginCallbackUrl,
4809
- activateUrl
4818
+ activateUrl,
4819
+ activateWithOTCUrl
4810
4820
  } = routes;
4811
4821
  let finalUrl = urlFromLocalStorage;
4812
- if (!finalUrl || [loginUrl, logoutUrl, socialLoginCallbackUrl, activateUrl].includes(finalUrl)) {
4822
+ if (!finalUrl || [loginUrl, logoutUrl, socialLoginCallbackUrl, activateUrl, activateWithOTCUrl].includes(finalUrl)) {
4813
4823
  finalUrl = authenticatedUrl;
4814
4824
  }
4815
4825
  const redirectUrl = (0,_helpers__WEBPACK_IMPORTED_MODULE_2__.getRedirectUrl)({
@@ -13284,7 +13294,8 @@ const _excluded = ["events", "url"];
13284
13294
  tenantId,
13285
13295
  userId,
13286
13296
  tenants = [],
13287
- activeTenant
13297
+ activeTenant,
13298
+ activationToken
13288
13299
  } = await api.auth.signUpUser(
13289
13300
  //Currently we are not supporting phone number in signup in the backend
13290
13301
  //Remove this line when we will support it (also make sure when field is optional no empty string is sent)
@@ -13306,7 +13317,8 @@ const _excluded = ["events", "url"];
13306
13317
  authenticationType: _interfaces__WEBPACK_IMPORTED_MODULE_6__.AuthenticationTypes.PASSWORD,
13307
13318
  id: userId,
13308
13319
  tenantId,
13309
- createdAt: new Date()
13320
+ createdAt: new Date(),
13321
+ activationToken
13310
13322
  };
13311
13323
  events == null ? void 0 : (_events$signUpComplet = events.signUpComplete) == null ? void 0 : _events$signUpComplet.call(events, signUpCompletePayload);
13312
13324
  (0,_helpers_gtm__WEBPACK_IMPORTED_MODULE_7__.reportGTMEvent)(_helpers_gtm__WEBPACK_IMPORTED_MODULE_7__.GTMEventAction.SIGNUP_COMPLETED, signUpCompletePayload);
@@ -13315,6 +13327,18 @@ const _excluded = ["events", "url"];
13315
13327
  const mfaRequiredState = await actions.getMfaRequiredState(user, _constants__WEBPACK_IMPORTED_MODULE_8__.DEFAULT_RETRY_CONFIG, true, payload.email);
13316
13328
  actions.setAuthState(mfaRequiredState);
13317
13329
  onRedirectTo(routes.loginUrl);
13330
+ } else if (shouldActivate && activationToken) {
13331
+ const searchParams = new URLSearchParams({
13332
+ userId: userId || '',
13333
+ token: activationToken || ''
13334
+ });
13335
+ const url = `${routes.activateWithOTCUrl}?${searchParams.toString()}`;
13336
+ setSignUpState({
13337
+ loading: false,
13338
+ shouldActivate,
13339
+ stage: _interfaces__WEBPACK_IMPORTED_MODULE_9__.SignUpStage.SignUpSuccess
13340
+ });
13341
+ onRedirectTo(url);
13318
13342
  } else {
13319
13343
  const tenantsState = store.auth.tenantsState;
13320
13344
  setSignUpState({
@@ -15758,7 +15782,7 @@ __webpack_require__.r(__webpack_exports__);
15758
15782
  error: undefined,
15759
15783
  unlockAccountSuccess: true
15760
15784
  });
15761
- await (0,_helpers__WEBPACK_IMPORTED_MODULE_0__.delay)(1000);
15785
+ await (0,_helpers__WEBPACK_IMPORTED_MODULE_0__.delay)(5000);
15762
15786
  onRedirectTo(routes.loginUrl);
15763
15787
  } catch (e) {
15764
15788
  setUnlockAccountState({
@@ -18040,7 +18064,7 @@ __webpack_require__.r(__webpack_exports__);
18040
18064
  /* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
18041
18065
  /* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
18042
18066
  /* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
18043
- /** @license Frontegg v7.53.0
18067
+ /** @license Frontegg v7.54.0
18044
18068
  *
18045
18069
  * This source code is licensed under the MIT license found in the
18046
18070
  * LICENSE file in the root directory of this source tree.
@@ -26552,7 +26576,8 @@ class AuthenticationApi extends _BaseApiClient__WEBPACK_IMPORTED_MODULE_6__.Base
26552
26576
  shouldActivate,
26553
26577
  authResponse,
26554
26578
  userId,
26555
- tenantId
26579
+ tenantId,
26580
+ activationToken
26556
26581
  } = await this.post(`${_constants__WEBPACK_IMPORTED_MODULE_11__.urls.identity.users.v1}/signUp`, body);
26557
26582
  const response = {
26558
26583
  shouldActivate,
@@ -26571,7 +26596,9 @@ class AuthenticationApi extends _BaseApiClient__WEBPACK_IMPORTED_MODULE_6__.Base
26571
26596
  activeTenant
26572
26597
  });
26573
26598
  }
26574
- return response;
26599
+ return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, response, {
26600
+ activationToken
26601
+ });
26575
26602
  };
26576
26603
  this.getCurrentUserSessions = async () => {
26577
26604
  return this.get(_constants__WEBPACK_IMPORTED_MODULE_11__.urls.identity.users.sessions.currentUser.v1);
@@ -28084,7 +28111,7 @@ __webpack_require__.r(__webpack_exports__);
28084
28111
  /* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
28085
28112
  /* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
28086
28113
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
28087
- /** @license Frontegg v7.53.0
28114
+ /** @license Frontegg v7.54.0
28088
28115
  *
28089
28116
  * This source code is licensed under the MIT license found in the
28090
28117
  * LICENSE file in the root directory of this source tree.
@@ -30714,7 +30741,7 @@ __webpack_require__.r(__webpack_exports__);
30714
30741
  /* harmony export */ });
30715
30742
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
30716
30743
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
30717
- /** @license Frontegg v7.53.0
30744
+ /** @license Frontegg v7.54.0
30718
30745
  *
30719
30746
  * This source code is licensed under the MIT license found in the
30720
30747
  * LICENSE file in the root directory of this source tree.