auth fixed

This commit is contained in:
2025-07-04 23:40:48 +05:30
parent 47bdcf87be
commit a8b89a28e3
2 changed files with 2 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ import staffRoutes from './staffs'
import pdfExtractionRoutes from './pdfExtraction'; import pdfExtractionRoutes from './pdfExtraction';
import claimsRoutes from './claims'; import claimsRoutes from './claims';
import insuranceCredsRoutes from './insuranceCreds'; import insuranceCredsRoutes from './insuranceCreds';
import documentRoutes from './documenets'; import documentRoutes from './documents';
const router = Router(); const router = Router();

View File

@@ -4,7 +4,6 @@ const API_BASE_URL = import.meta.env.VITE_API_BASE_URL_BACKEND ?? "";
async function throwIfResNotOk(res: Response) { async function throwIfResNotOk(res: Response) {
if (!res.ok) { if (!res.ok) {
const text = (await res.text()) || res.statusText;
if (res.status === 401 || res.status === 403) { if (res.status === 401 || res.status === 403) {
localStorage.removeItem("token"); localStorage.removeItem("token");
@@ -14,7 +13,7 @@ async function throwIfResNotOk(res: Response) {
} }
return; return;
} }
throw new Error(`${res.status}: ${text}`); throw new Error(`${res.status}: ${res.statusText}`);
} }
} }