@iblai/web-utils 1.7.3 → 1.8.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/dist/index.d.ts +1 -0
- package/dist/index.esm.js +8 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/web-utils/src/utils/auth.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1181,17 +1181,19 @@ async function redirectToAuthSpa(options) {
|
|
|
1181
1181
|
logoutTimestamp: "ibl_logout_timestamp",
|
|
1182
1182
|
loginTimestamp: "ibl_login_timestamp",
|
|
1183
1183
|
tenantSwitching: "ibl_tenant_switching",
|
|
1184
|
-
}, hasNonExpiredAuthToken, isOffline, preserveTokenKey, authRedirectProxy, isNativeApp, } = options;
|
|
1185
|
-
console.log("[redirectToAuthSpa] starting redirect to auth spa", redirectTo, platformKey, logout, saveRedirect);
|
|
1184
|
+
}, hasNonExpiredAuthToken, isOffline, preserveTokenKey, authRedirectProxy, isNativeApp, forceRedirect = false, } = options;
|
|
1185
|
+
console.log("[redirectToAuthSpa] starting redirect to auth spa", redirectTo, platformKey, logout, saveRedirect, forceRedirect);
|
|
1186
1186
|
// Skip if a tenant switch is already in progress
|
|
1187
|
-
if (
|
|
1187
|
+
if (!forceRedirect &&
|
|
1188
|
+
cookieNames.tenantSwitching &&
|
|
1188
1189
|
document.cookie.includes(cookieNames.tenantSwitching)) {
|
|
1189
1190
|
console.log("[redirectToAuthSpa] Tenant switch in progress, skipping redirect");
|
|
1190
1191
|
return;
|
|
1191
1192
|
}
|
|
1192
1193
|
// Skip if a login occurred after the last logout (login takes precedence)
|
|
1193
1194
|
// but only if this app actually has a valid auth token
|
|
1194
|
-
if (
|
|
1195
|
+
if (!forceRedirect &&
|
|
1196
|
+
hasNonExpiredAuthToken &&
|
|
1195
1197
|
cookieNames.loginTimestamp &&
|
|
1196
1198
|
cookieNames.logoutTimestamp) {
|
|
1197
1199
|
const loginTs = getCookieValue(cookieNames.loginTimestamp);
|
|
@@ -1203,7 +1205,8 @@ async function redirectToAuthSpa(options) {
|
|
|
1203
1205
|
hasValidToken,
|
|
1204
1206
|
loginAhead: loginTs && logoutTs ? Number(loginTs) > Number(logoutTs) : false,
|
|
1205
1207
|
});
|
|
1206
|
-
if (
|
|
1208
|
+
if (!forceRedirect &&
|
|
1209
|
+
hasValidToken &&
|
|
1207
1210
|
loginTs &&
|
|
1208
1211
|
logoutTs &&
|
|
1209
1212
|
Number(loginTs) > Number(logoutTs)) {
|