diff --git a/web/src/api/index.tsx b/web/src/api/index.tsx index cba5b6962..df6057813 100644 --- a/web/src/api/index.tsx +++ b/web/src/api/index.tsx @@ -25,8 +25,8 @@ export function ApiProvider({ children, options }: ApiProviderType) { return axios.get(path, { params }).then((res) => res.data); }, onError: (error, _key) => { - if (error.status === 401) { - window.location.reload(); + if (error.response.status === 401) { + window.location.href = "login"; } }, ...options,