fix login
This commit is contained in:
parent
4c51d45708
commit
36a363a2f0
|
|
@ -41,7 +41,10 @@ class ApiClient {
|
|||
if (error.response?.status === 401) {
|
||||
localStorage.removeItem('access_token');
|
||||
localStorage.removeItem('refresh_token');
|
||||
window.location.href = '/login';
|
||||
// Redirect only if not already on login/register page
|
||||
if (!['/login', '/register'].includes(window.location.pathname)) {
|
||||
window.location.href = '/login';
|
||||
}
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue