@frontegg/redux-store 6.166.0 → 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.
@@ -1312,14 +1312,25 @@ function* logout({
1312
1312
  payload
1313
1313
  }) {
1314
1314
  const {
1315
- hostedLoginBox
1316
- } = yield select(state => state.auth);
1315
+ hostedLoginBox,
1316
+ isNextJs
1317
+ } = yield select(state => ({
1318
+ hostedLoginBox: state.auth.hostedLoginBox,
1319
+ isNextJs: state.root.framework === 'nextjs'
1320
+ }));
1317
1321
  yield put(actions.setState({
1318
1322
  isLoading: true
1319
1323
  }));
1320
1324
  try {
1321
1325
  if (hostedLoginBox) {
1322
1326
  yield call(api.auth.OAuthLogout);
1327
+ if (isNextJs) {
1328
+ var _ContextHolder$getCon;
1329
+ const contextBaseUrl = (_ContextHolder$getCon = ContextHolder.getContext()) == null ? void 0 : _ContextHolder$getCon.baseUrl;
1330
+ const baseUrl = typeof contextBaseUrl === 'function' ? contextBaseUrl('') : contextBaseUrl;
1331
+ const logoutRoute = `${baseUrl}/oauth/logout?post_logout_redirect_uri=${encodeURIComponent(window.location.href)}`;
1332
+ window.location.href = logoutRoute;
1333
+ }
1323
1334
  } else {
1324
1335
  yield call(api.auth.logout);
1325
1336
  }
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.166.0
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.
@@ -1338,14 +1338,25 @@ function* logout({
1338
1338
  payload
1339
1339
  }) {
1340
1340
  const {
1341
- hostedLoginBox
1342
- } = yield (0, _effects.select)(state => state.auth);
1341
+ hostedLoginBox,
1342
+ isNextJs
1343
+ } = yield (0, _effects.select)(state => ({
1344
+ hostedLoginBox: state.auth.hostedLoginBox,
1345
+ isNextJs: state.root.framework === 'nextjs'
1346
+ }));
1343
1347
  yield (0, _effects.put)(_reducer.actions.setState({
1344
1348
  isLoading: true
1345
1349
  }));
1346
1350
  try {
1347
1351
  if (hostedLoginBox) {
1348
1352
  yield (0, _effects.call)(_restApi.api.auth.OAuthLogout);
1353
+ if (isNextJs) {
1354
+ var _ContextHolder$getCon;
1355
+ const contextBaseUrl = (_ContextHolder$getCon = _restApi.ContextHolder.getContext()) == null ? void 0 : _ContextHolder$getCon.baseUrl;
1356
+ const baseUrl = typeof contextBaseUrl === 'function' ? contextBaseUrl('') : contextBaseUrl;
1357
+ const logoutRoute = `${baseUrl}/oauth/logout?post_logout_redirect_uri=${encodeURIComponent(window.location.href)}`;
1358
+ window.location.href = logoutRoute;
1359
+ }
1349
1360
  } else {
1350
1361
  yield (0, _effects.call)(_restApi.api.auth.logout);
1351
1362
  }
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.166.0
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
- "version": "6.166.0",
3
+ "version": "6.167.0-alpha.0",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",
@@ -4,4 +4,5 @@ export interface RootState {
4
4
  urlStrategy: 'hash' | 'path';
5
5
  previewMode?: boolean;
6
6
  appName: string;
7
+ framework?: 'nextjs' | 'react' | 'angular' | 'vuejs' | 'flutter';
7
8
  }