fix: improve error handling and session management in various handlers and middleware

This commit is contained in:
GitHub Actions
2026-02-14 00:51:40 +00:00
parent c7d013c503
commit f906f4a21f
6 changed files with 139 additions and 60 deletions

View File

@@ -55,7 +55,11 @@ client.interceptors.response.use(
console.warn('Authentication failed:', error.config?.url);
// Skip auth error handling for login/auth endpoints to avoid redirect loops
const url = error.config?.url || '';
const isAuthEndpoint = url.includes('/auth/login') || url.includes('/auth/me');
const isAuthEndpoint =
url.includes('/auth/login') ||
url.includes('/auth/me') ||
url.includes('/auth/logout') ||
url.includes('/auth/refresh');
if (onAuthError && !isAuthEndpoint) {
onAuthError();
}