@frontegg/js 6.166.0-alpha.3 → 6.167.0-alpha.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 v6.166.0-alpha.3
1
+ /** @license Frontegg v6.167.0-alpha.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 v6.166.0-alpha.3
1
+ /** @license Frontegg v6.167.0-alpha.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: '6.166.0-alpha.3'
8
+ cdnVersion: '6.167.0-alpha.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": "6.166.0-alpha.3",
3
+ "version": "6.167.0-alpha.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": "6.166.0-alpha.3"
9
+ "@frontegg/types": "6.167.0-alpha.0"
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.166.0-alpha.3'
1448
+ cdnVersion: '6.167.0-alpha.0'
1449
1449
  });
1450
1450
 
1451
1451
  /***/ }),
@@ -7226,14 +7226,25 @@ function* logout({
7226
7226
  payload
7227
7227
  }) {
7228
7228
  const {
7229
- hostedLoginBox
7230
- } = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.select)(state => state.auth);
7229
+ hostedLoginBox,
7230
+ isNextJs
7231
+ } = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.select)(state => ({
7232
+ hostedLoginBox: state.auth.hostedLoginBox,
7233
+ isNextJs: state.root.framework === 'nextjs'
7234
+ }));
7231
7235
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.put)(_reducer__WEBPACK_IMPORTED_MODULE_5__.actions.setState({
7232
7236
  isLoading: true
7233
7237
  }));
7234
7238
  try {
7235
7239
  if (hostedLoginBox) {
7236
7240
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_4__.api.auth.OAuthLogout);
7241
+ if (isNextJs) {
7242
+ var _ContextHolder$getCon;
7243
+ const contextBaseUrl = (_ContextHolder$getCon = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_6__.ContextHolder.getContext()) == null ? void 0 : _ContextHolder$getCon.baseUrl;
7244
+ const baseUrl = typeof contextBaseUrl === 'function' ? contextBaseUrl('') : contextBaseUrl;
7245
+ const logoutRoute = `${baseUrl}/oauth/logout?post_logout_redirect_uri=${encodeURIComponent(window.location.href)}`;
7246
+ window.location.href = logoutRoute;
7247
+ }
7237
7248
  } else {
7238
7249
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_4__.api.auth.logout);
7239
7250
  }
@@ -24716,7 +24727,7 @@ __webpack_require__.r(__webpack_exports__);
24716
24727
  /* harmony export */ });
24717
24728
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
24718
24729
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
24719
- /** @license Frontegg v6.166.0-alpha.3
24730
+ /** @license Frontegg v6.167.0-alpha.0
24720
24731
  *
24721
24732
  * This source code is licensed under the MIT license found in the
24722
24733
  * LICENSE file in the root directory of this source tree.