Improve authentication flow and navigation handling
- Replace never-resolving promise with rejection - Remove unnecessary setTimeout in navigation
This commit is contained in:
@@ -186,8 +186,9 @@ axiosInstance.interceptors.response.use(
|
||||
}
|
||||
// For other APIs, navigate to login page
|
||||
navigationService.navigateToLogin();
|
||||
// Return a never-resolving promise to prevent further execution
|
||||
return new Promise(() => {});
|
||||
|
||||
// return a reject Promise
|
||||
return Promise.reject(new Error('Authentication required'));
|
||||
}
|
||||
throw new Error(
|
||||
`${error.response.status} ${error.response.statusText}\n${JSON.stringify(
|
||||
|
Reference in New Issue
Block a user