fix: add error feedback for failed login attempts
This commit is contained in:
@@ -22,9 +22,12 @@ apiClient.interceptors.response.use(
|
||||
(response) => response,
|
||||
(error) => {
|
||||
if (error.response?.status === 401) {
|
||||
localStorage.removeItem('authToken');
|
||||
localStorage.removeItem('currentUser');
|
||||
window.location.href = '/login';
|
||||
const url = error.config?.url || '';
|
||||
if (!url.includes('/auth/login')) {
|
||||
localStorage.removeItem('authToken');
|
||||
localStorage.removeItem('currentUser');
|
||||
window.location.href = '/login';
|
||||
}
|
||||
}
|
||||
if (error.response?.status === 404) {
|
||||
const url = error.config?.url || '';
|
||||
|
||||
Reference in New Issue
Block a user