add status check after refetch
All checks were successful
Deploy Amap / deploy (push) Successful in 42s
All checks were successful
Deploy Amap / deploy (push) Successful in 42s
This commit is contained in:
@@ -50,6 +50,13 @@ export async function fetchWithAuth(input: RequestInfo, options?: RequestInit, r
|
||||
credentials: "include",
|
||||
...options,
|
||||
});
|
||||
if (res.status === 401) {
|
||||
if (redirect)
|
||||
window.location.href = `/?sessionExpired=True`;
|
||||
const error = new Error("Unauthorized");
|
||||
error.cause = 401
|
||||
throw error;
|
||||
}
|
||||
return newRes;
|
||||
}
|
||||
if (res.status == 403) {
|
||||
|
||||
Reference in New Issue
Block a user