@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.
- package/auth/LoginState/saga.js +13 -2
- package/index.js +1 -1
- package/node/auth/LoginState/saga.js +13 -2
- package/node/index.js +1 -1
- package/package.json +1 -1
- package/toolkit/interfaces.d.ts +1 -0
package/auth/LoginState/saga.js
CHANGED
|
@@ -1312,14 +1312,25 @@ function* logout({
|
|
|
1312
1312
|
payload
|
|
1313
1313
|
}) {
|
|
1314
1314
|
const {
|
|
1315
|
-
hostedLoginBox
|
|
1316
|
-
|
|
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
|
@@ -1338,14 +1338,25 @@ function* logout({
|
|
|
1338
1338
|
payload
|
|
1339
1339
|
}) {
|
|
1340
1340
|
const {
|
|
1341
|
-
hostedLoginBox
|
|
1342
|
-
|
|
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
package/package.json
CHANGED