fix: prevent expired-token login refresh loop

This commit is contained in:
whyour
2026-09-19 13:23:28 +08:00
parent d9833c17d5
commit 6acb665369
3 changed files with 158 additions and 9 deletions
+3 -7
View File
@@ -114,13 +114,9 @@ export default function () {
history.push('/error');
}
})
.catch((error) => {
const responseStatus = error.response.status;
if (responseStatus !== 401) {
history.push('/error');
} else {
window.location.reload();
}
.catch(() => {
// Health is anonymous; a failure must not trigger a page reload loop.
history.push('/error');
})
.finally(() => setInitLoading(false));
};