diff --git a/src/services/apiRequest.ts b/src/services/apiRequest.ts index 441d9b6..c4a4699 100644 --- a/src/services/apiRequest.ts +++ b/src/services/apiRequest.ts @@ -10,7 +10,7 @@ const AxiosConfigs = { return { headers: { "content-type": "application/json", - Authorization: `Bearer ${typeof window !== "undefined" ? window.localStorage.getItem("sub") : "not-ssr"}`, + Authorization: `Bearer ${typeof window !== "undefined" ? JSON.parse(window.localStorage.getItem("sub") || "not-ssr") : "not-ssr"}`, }, validateStatus: (status: number) => { return status < 500; // Resolve only if the status code is less than 500