fix: keep auth form errors visible

This commit is contained in:
yangqianqian
2026-07-01 10:26:42 +08:00
parent 341f3d2b0d
commit 232fd35c90

View File

@@ -63,7 +63,10 @@ async function request<T>(
}
const err = body as ApiError;
if (err.code === ERROR_CODES.UNAUTHENTICATED) {
const shouldRedirectOnUnauthorized =
!path.includes('/api/v1/auth/login') &&
!path.includes('/api/v1/auth/change-password');
if (err.code === ERROR_CODES.UNAUTHENTICATED && shouldRedirectOnUnauthorized) {
const newToken = await refreshToken();
if (newToken) {
setToken(newToken);