@banch0u/core-project-test-repository 1.3.1 → 1.3.2
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/utils/axios.js +7 -6
- package/package.json +1 -1
package/dist/utils/axios.js
CHANGED
|
@@ -134,13 +134,13 @@ api.interceptors.response.use(function (response) {
|
|
|
134
134
|
// Pass through successful responses
|
|
135
135
|
function () {
|
|
136
136
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(error) {
|
|
137
|
-
var originalRequest, newAccessToken;
|
|
137
|
+
var originalRequest, newAccessToken, basePath, redirectPath;
|
|
138
138
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
139
139
|
while (1) switch (_context2.prev = _context2.next) {
|
|
140
140
|
case 0:
|
|
141
141
|
originalRequest = error.config;
|
|
142
142
|
if (!(error.response.status === 401 && !originalRequest._retry)) {
|
|
143
|
-
_context2.next =
|
|
143
|
+
_context2.next = 18;
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
146
|
originalRequest._retry = true; // Prevent infinite retry loops
|
|
@@ -154,13 +154,14 @@ function () {
|
|
|
154
154
|
case 11:
|
|
155
155
|
_context2.prev = 11;
|
|
156
156
|
_context2.t0 = _context2["catch"](3);
|
|
157
|
-
|
|
157
|
+
basePath = window.location.pathname.split("/")[1];
|
|
158
|
+
redirectPath = "/".concat(basePath, "/login");
|
|
158
159
|
console.error("Token refresh failed:", _context2.t0);
|
|
159
|
-
window.location.href =
|
|
160
|
+
window.location.href = redirectPath;
|
|
160
161
|
return _context2.abrupt("return", Promise.reject(_context2.t0));
|
|
161
|
-
case
|
|
162
|
+
case 18:
|
|
162
163
|
return _context2.abrupt("return", Promise.reject(error));
|
|
163
|
-
case
|
|
164
|
+
case 19:
|
|
164
165
|
case "end":
|
|
165
166
|
return _context2.stop();
|
|
166
167
|
}
|