|
@@ -72,9 +72,7 @@ export async function getInitialState(): Promise<{
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const fetchUserInfo = async (config?: {
|
|
|
|
|
- skipErrorHandler?: boolean;
|
|
|
|
|
- }): Promise<Global.UserInfo> => {
|
|
|
|
|
|
|
+ const fetchUserInfo = async (): Promise<Global.UserInfo> => {
|
|
|
try {
|
|
try {
|
|
|
const data = await queryCurrentUserState({
|
|
const data = await queryCurrentUserState({
|
|
|
skipErrorHandler: true
|
|
skipErrorHandler: true
|
|
@@ -96,10 +94,8 @@ export async function getInitialState(): Promise<{
|
|
|
duration: 5
|
|
duration: 5
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- // Only redirect if not skipping error handler, or if error is not 401
|
|
|
|
|
- if (!config?.skipErrorHandler) {
|
|
|
|
|
- history.push(DEFAULT_ENTER_PAGE.login);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // Don't redirect here — let the error handler do it
|
|
|
|
|
+ // This avoids double-redirect and respects skipErrorHandler
|
|
|
}
|
|
}
|
|
|
return {} as Global.UserInfo;
|
|
return {} as Global.UserInfo;
|
|
|
};
|
|
};
|