fix: keep auth form errors visible
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user