login page refactor
This commit is contained in:
1 parent
ea68e660fc
commit
514570da78
3 files changed
+35
-18
No files matched your search
@@ -42,7 +42,9 @@ export const initApiClient = (store: StoreType): void => {
|
||||
const onSuccess = (response: AxiosResponse) => response;
|
||||
const onError = (error: AxiosError) => {
|
||||
if (error.response?.status === 401) {
|
||||
window.location.href = "/login";
|
||||
if (window.location.pathname !== "/login") {
|
||||
window.location.href = "/login";
|
||||
}
|
||||
}
|
||||
return Promise.reject(error);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user