Private
Public Access
1
0

fix: graceful login error handling and remove hard redirects
Some checks failed
CI Pipeline / Rust Format Check (push) Failing after 35s
CI Pipeline / Clippy Lints (push) Successful in 45s
CI Pipeline / Rust Unit Tests (push) Successful in 1m2s
CI Pipeline / Security Audit (push) Successful in 4s
CI Pipeline / Frontend Lint & Type Check (push) Successful in 13s
CI Pipeline / Build .deb & Release (push) Has been skipped

- LoginPage.tsx: proper error handling for network errors, rate limiting
  (429), MFA required, account disabled, and server errors
- LoginPage.tsx: dismissible error alerts with onClose
- LoginPage.tsx: added 🐉 branding to login title
- client.ts: removed window.location.href hard redirects on auth failure
  (now uses React state-based logout instead of full page reload)
- client.ts: auth errors now propagate naturally through React Router
This commit is contained in:
2026-04-29 01:27:58 +00:00
parent 8ef118a515
commit eec976d093
2 changed files with 61 additions and 10 deletions

View File

@ -60,10 +60,8 @@ apiClient.interceptors.response.use(
isRefreshing = true
const { refreshToken, setTokens, logout } = useAuthStore.getState()
if (!refreshToken) {
logout()
window.location.href = '/login'
return Promise.reject(error)
}
@ -78,7 +76,6 @@ apiClient.interceptors.response.use(
} catch (refreshError) {
processQueue(refreshError, null)
logout()
window.location.href = '/login'
return Promise.reject(refreshError)
} finally {
isRefreshing = false