@dexteel/mesf-core 3.11.8 → 3.11.9
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/CHANGELOG.md +2 -0
- package/dist/index.esm.js +8 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -4906,7 +4906,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4906
4906
|
throw new FetchError(errorMsg.message, 404, "ERR_CONNECTION_REFUSED");
|
|
4907
4907
|
})
|
|
4908
4908
|
.then(function (response) {
|
|
4909
|
-
if (response.status === 401) {
|
|
4909
|
+
if (response.status === 499 || response.status === 401) {
|
|
4910
4910
|
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4911
4911
|
}
|
|
4912
4912
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
@@ -4958,7 +4958,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4958
4958
|
throw new FetchError(errorMsg.message, 404, "ERR_CONNECTION_REFUSED");
|
|
4959
4959
|
})
|
|
4960
4960
|
.then(function (response) {
|
|
4961
|
-
if (response.status === 401) {
|
|
4961
|
+
if (response.status === 499 || response.status === 401) {
|
|
4962
4962
|
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4963
4963
|
}
|
|
4964
4964
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
@@ -5013,7 +5013,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
5013
5013
|
throw new FetchError(errorMsg.message, 404, "ERR_CONNECTION_REFUSED");
|
|
5014
5014
|
})
|
|
5015
5015
|
.then(function (response) {
|
|
5016
|
-
if (response.status === 401) {
|
|
5016
|
+
if (response.status === 499 || response.status === 401) {
|
|
5017
5017
|
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
5018
5018
|
}
|
|
5019
5019
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
@@ -5066,7 +5066,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
5066
5066
|
throw new FetchError(errorMsg.message, 404, "ERR_CONNECTION_REFUSED");
|
|
5067
5067
|
})
|
|
5068
5068
|
.then(function (response) {
|
|
5069
|
-
if (response.status === 401) {
|
|
5069
|
+
if (response.status === 499 || response.status === 401) {
|
|
5070
5070
|
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
5071
5071
|
}
|
|
5072
5072
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
@@ -5135,7 +5135,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
5135
5135
|
throw new FetchError(errorMsg.message, 404, "ERR_CONNECTION_REFUSED");
|
|
5136
5136
|
})
|
|
5137
5137
|
.then(function (response) {
|
|
5138
|
-
if (response.status === 401) {
|
|
5138
|
+
if (response.status === 499 || response.status === 401) {
|
|
5139
5139
|
window.location.href = "".concat(base$2, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
5140
5140
|
}
|
|
5141
5141
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
@@ -5427,8 +5427,8 @@ function renewToken() {
|
|
|
5427
5427
|
});
|
|
5428
5428
|
}
|
|
5429
5429
|
function isUnauthorizedError(error) {
|
|
5430
|
-
var
|
|
5431
|
-
return status ===
|
|
5430
|
+
var status = error.response.status;
|
|
5431
|
+
return status === 499 || status === 499; // custom status code
|
|
5432
5432
|
}
|
|
5433
5433
|
var axiosInstance = axios.create({
|
|
5434
5434
|
headers: {
|
|
@@ -5472,7 +5472,7 @@ axiosInstance.interceptors.response.use(function (res) { return res; }, function
|
|
|
5472
5472
|
case 4: return [2 /*return*/, _b.sent()];
|
|
5473
5473
|
case 5:
|
|
5474
5474
|
innerError_1 = _b.sent();
|
|
5475
|
-
// if original req failed with
|
|
5475
|
+
// if original req failed with 499 again - it means server returned not valid token for refresh request
|
|
5476
5476
|
if (isUnauthorizedError(innerError_1)) {
|
|
5477
5477
|
return [2 /*return*/, innerError_1];
|
|
5478
5478
|
}
|