@frontegg/js 6.167.0 → 6.168.0-alpha.1

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 v6.167.0
1
+ /** @license Frontegg v6.168.0-alpha.1
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 v6.167.0
1
+ /** @license Frontegg v6.168.0-alpha.1
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.167.0'
8
+ cdnVersion: '6.168.0-alpha.1'
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.167.0",
3
+ "version": "6.168.0-alpha.1",
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.167.0"
9
+ "@frontegg/types": "6.168.0-alpha.1"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [
@@ -1445,7 +1445,7 @@ __webpack_require__.r(__webpack_exports__);
1445
1445
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1446
1446
  /* harmony export */ });
1447
1447
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1448
- cdnVersion: '6.167.0'
1448
+ cdnVersion: '6.168.0-alpha.1'
1449
1449
  });
1450
1450
 
1451
1451
  /***/ }),
@@ -3889,6 +3889,7 @@ __webpack_require__.r(__webpack_exports__);
3889
3889
  /* harmony export */ "customLoginEnabled": () => (/* binding */ customLoginEnabled),
3890
3890
  /* harmony export */ "customLoginSagas": () => (/* binding */ customLoginSagas),
3891
3891
  /* harmony export */ "customLoginSagasMock": () => (/* binding */ customLoginSagasMock),
3892
+ /* harmony export */ "getCustomLoginAlias": () => (/* binding */ getCustomLoginAlias),
3892
3893
  /* harmony export */ "loadCustomLoginRoutes": () => (/* binding */ loadCustomLoginRoutes),
3893
3894
  /* harmony export */ "loadTenantMetadata": () => (/* binding */ loadTenantMetadata)
3894
3895
  /* harmony export */ });
@@ -3964,20 +3965,32 @@ function* updateTenantMetadata(_ref) {
3964
3965
  }
3965
3966
  }
3966
3967
  function* customLoginEnabled() {
3967
- var _yield$ContextHolder$, _ContextHolder$getCon, _ContextHolder$getCon2;
3968
- const isAuthenticated = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.select)(state => state.auth.isAuthenticated);
3969
- if (isAuthenticated) {
3970
- var _select;
3971
- const tenantHasCustomLogin = yield (_select = (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.select)(({
3972
- auth
3973
- }) => {
3974
- var _auth$tenantsState$ac;
3975
- return (_auth$tenantsState$ac = auth.tenantsState.activeTenant) == null ? void 0 : _auth$tenantsState$ac.hasCustomLogin;
3976
- })) != null ? _select : false;
3977
- return tenantHasCustomLogin;
3968
+ const customLoginAlias = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(getCustomLoginAlias);
3969
+ return !!customLoginAlias;
3970
+ }
3971
+ function* getCustomLoginAlias() {
3972
+ const context = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_7__.ContextHolder.getContext();
3973
+ if (!(context != null && context.tenantResolver)) {
3974
+ return;
3975
+ }
3976
+ const resolvedTenantResult = yield context.tenantResolver();
3977
+ if (resolvedTenantResult != null && resolvedTenantResult.tenant) {
3978
+ return resolvedTenantResult.tenant;
3979
+ }
3980
+ const {
3981
+ customLoginAlias,
3982
+ hasCustomLogin
3983
+ } = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.select)(state => {
3984
+ var _state$auth, _state$auth$tenantsSt;
3985
+ const activeTenant = (_state$auth = state.auth) == null ? void 0 : (_state$auth$tenantsSt = _state$auth.tenantsState) == null ? void 0 : _state$auth$tenantsSt.activeTenant;
3986
+ return {
3987
+ customLoginAlias: activeTenant == null ? void 0 : activeTenant.alias,
3988
+ hasCustomLogin: activeTenant == null ? void 0 : activeTenant.hasCustomLogin
3989
+ };
3990
+ });
3991
+ if (hasCustomLogin) {
3992
+ return customLoginAlias;
3978
3993
  }
3979
- const resolvedTenant = (_yield$ContextHolder$ = yield (_ContextHolder$getCon = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_7__.ContextHolder.getContext()) == null ? void 0 : (_ContextHolder$getCon2 = _ContextHolder$getCon.tenantResolver) == null ? void 0 : _ContextHolder$getCon2.call(_ContextHolder$getCon)) == null ? void 0 : _yield$ContextHolder$.tenant;
3980
- return !!resolvedTenant;
3981
3994
  }
3982
3995
  function* loadCustomLoginRoutes() {
3983
3996
  try {
@@ -6482,11 +6495,10 @@ function* requestHostedLoginAuthorize(additionalParams) {
6482
6495
  code_challenge_method: 'S256',
6483
6496
  nonce
6484
6497
  }, additionalParams);
6485
- if (context.tenantResolver) {
6486
- var _context$tenantResolv;
6487
- const resolvedTenantResult = yield (_context$tenantResolv = context.tenantResolver) == null ? void 0 : _context$tenantResolv.call(context);
6488
- if (resolvedTenantResult != null && resolvedTenantResult.tenant) {
6489
- params['organization'] = resolvedTenantResult.tenant;
6498
+ if (!(additionalParams != null && additionalParams.organization)) {
6499
+ const customLoginAlias = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_CustomLoginState_saga__WEBPACK_IMPORTED_MODULE_15__.getCustomLoginAlias);
6500
+ if (customLoginAlias) {
6501
+ params['organization'] = customLoginAlias;
6490
6502
  }
6491
6503
  }
6492
6504
  const tenantId = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.getSearchParam)(_utils__WEBPACK_IMPORTED_MODULE_8__.TENANT_ID_PARAM_KEY);
@@ -24728,7 +24740,7 @@ __webpack_require__.r(__webpack_exports__);
24728
24740
  /* harmony export */ });
24729
24741
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
24730
24742
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
24731
- /** @license Frontegg v6.167.0
24743
+ /** @license Frontegg v6.168.0-alpha.1
24732
24744
  *
24733
24745
  * This source code is licensed under the MIT license found in the
24734
24746
  * LICENSE file in the root directory of this source tree.