failed tests btw

This commit is contained in:
2026-03-14 23:42:21 +03:00
parent 2a8b6a7b62
commit 6428459313
2 changed files with 17 additions and 7 deletions
+4 -2
View File
@@ -51,8 +51,10 @@ export function AuthProvider({ children }) {
setLoading(false);
})
.catch((err) => {
const status = err instanceof ApiError ? err.status : err?.status;
if (status !== 401) {
const status = ApiError && err instanceof ApiError ? err.status : err?.status;
const message = typeof err?.message === "string" ? err.message : "";
const isUnauthorized = status === 401 || message.includes("401");
if (!isUnauthorized) {
setLoading(false);
return;
}