@frontegg/js 7.60.0 → 7.61.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.60.0
1
+ /** @license Frontegg v7.61.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.60.0
1
+ /** @license Frontegg v7.61.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.60.0'
8
+ cdnVersion: '7.61.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.60.0",
3
+ "version": "7.61.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.60.0"
9
+ "@frontegg/types": "7.61.0"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [
@@ -1630,7 +1630,7 @@ __webpack_require__.r(__webpack_exports__);
1630
1630
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1631
1631
  /* harmony export */ });
1632
1632
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1633
- cdnVersion: '7.60.0'
1633
+ cdnVersion: '7.61.0'
1634
1634
  });
1635
1635
 
1636
1636
  /***/ }),
@@ -15774,24 +15774,38 @@ __webpack_require__.r(__webpack_exports__);
15774
15774
  const switchTenant = async payload => {
15775
15775
  const {
15776
15776
  tenantId,
15777
+ silentReload,
15777
15778
  callback
15778
15779
  } = payload;
15779
- actions.setAuthState({
15780
+ silentReload ? actions.setTenantsState({
15781
+ switchingTenant: true
15782
+ }) : actions.setAuthState({
15780
15783
  isLoading: true
15781
15784
  });
15782
15785
  try {
15783
15786
  await api.tenants.switchTenant({
15784
15787
  tenantId
15785
15788
  });
15789
+ if (silentReload) {
15790
+ actions.resetAuthState({
15791
+ isLoading: false,
15792
+ isAuthenticated: true,
15793
+ user: store.auth.user
15794
+ });
15795
+ }
15786
15796
  await actions.__refreshToken();
15787
15797
  const callbackConsumed = callback == null ? void 0 : callback(true);
15788
15798
  if (!callbackConsumed) {
15789
- actions.setAuthState({
15799
+ silentReload ? actions.setTenantsState({
15800
+ switchingTenant: false
15801
+ }) : actions.setAuthState({
15790
15802
  isLoading: false
15791
15803
  });
15792
15804
  }
15793
15805
  } catch (e) {
15794
- actions.setAuthState({
15806
+ silentReload ? actions.setTenantsState({
15807
+ switchingTenant: false
15808
+ }) : actions.setAuthState({
15795
15809
  isLoading: false
15796
15810
  });
15797
15811
  callback == null ? void 0 : callback(false, e);
@@ -15889,6 +15903,7 @@ __webpack_require__.r(__webpack_exports__);
15889
15903
  const initialState = {
15890
15904
  tenants: [],
15891
15905
  subTenants: [],
15906
+ switchingTenant: false,
15892
15907
  loading: true,
15893
15908
  tenantTree: null
15894
15909
  };
@@ -16366,8 +16381,8 @@ const buildAuthActions = (store, api, actions, snapshotAuthState) => {
16366
16381
  }
16367
16382
  });
16368
16383
  };
16369
- const resetAuthState = () => {
16370
- (0,_helpers__WEBPACK_IMPORTED_MODULE_55__.deepResetState)(store, ['auth'], snapshotAuthState);
16384
+ const resetAuthState = (state = {}) => {
16385
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_55__.deepResetState)(store, ['auth'], (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, snapshotAuthState, state));
16371
16386
  };
16372
16387
  const setUser = user => {
16373
16388
  setAuthState({
@@ -18244,7 +18259,7 @@ __webpack_require__.r(__webpack_exports__);
18244
18259
  /* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
18245
18260
  /* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
18246
18261
  /* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
18247
- /** @license Frontegg v7.60.0
18262
+ /** @license Frontegg v7.61.0
18248
18263
  *
18249
18264
  * This source code is licensed under the MIT license found in the
18250
18265
  * LICENSE file in the root directory of this source tree.
@@ -28352,7 +28367,7 @@ __webpack_require__.r(__webpack_exports__);
28352
28367
  /* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
28353
28368
  /* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
28354
28369
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
28355
- /** @license Frontegg v7.60.0
28370
+ /** @license Frontegg v7.61.0
28356
28371
  *
28357
28372
  * This source code is licensed under the MIT license found in the
28358
28373
  * LICENSE file in the root directory of this source tree.
@@ -30982,7 +30997,7 @@ __webpack_require__.r(__webpack_exports__);
30982
30997
  /* harmony export */ });
30983
30998
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
30984
30999
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
30985
- /** @license Frontegg v7.60.0
31000
+ /** @license Frontegg v7.61.0
30986
31001
  *
30987
31002
  * This source code is licensed under the MIT license found in the
30988
31003
  * LICENSE file in the root directory of this source tree.