@banch0u/core-project-test-repository 1.3.0 → 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.
@@ -3,7 +3,9 @@
3
3
  width: 100%;
4
4
  align-items: center;
5
5
  flex-direction: column;
6
- margin-top: 87px;
6
+ padding-top: 87px;
7
+ height: 100vh;
8
+ background: #f8f8f8;
7
9
  .logo {
8
10
  svg {
9
11
  width: 250px;
@@ -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 = 16;
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
- // Handle failed token refresh logic (e.g., logout user)
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 = "/docflow/login"; //Comment this to prevent logout
160
+ window.location.href = redirectPath;
160
161
  return _context2.abrupt("return", Promise.reject(_context2.t0));
161
- case 16:
162
+ case 18:
162
163
  return _context2.abrupt("return", Promise.reject(error));
163
- case 17:
164
+ case 19:
164
165
  case "end":
165
166
  return _context2.stop();
166
167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banch0u/core-project-test-repository",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Shared core features for all projects",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -14,7 +14,7 @@
14
14
  "author": "banch0u",
15
15
  "license": "MIT",
16
16
  "scripts": {
17
- "clean": "rm -rf dist",
17
+ "clean": "rimraf dist",
18
18
  "build": "npm run clean && babel src --out-dir dist --copy-files",
19
19
  "watch": "chokidar \"src\" -i 'dist' -c \"npm run build && yalc push --force\"",
20
20
  "dev": "npm run watch"
@@ -37,6 +37,7 @@
37
37
  "@babel/preset-react": "^7.26.3",
38
38
  "babel-loader": "^9.2.1",
39
39
  "chokidar-cli": "^3.0.0",
40
- "npm-run-all": "^4.1.5"
40
+ "npm-run-all": "^4.1.5",
41
+ "rimraf": "^6.0.1"
41
42
  }
42
43
  }