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
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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user