- const homeCluster = services.authService.getHomeCluster();
- if (token) {
- setAuthorizationHeader(services, token);
- }
- dispatch(authActions.CONFIG({ config }));
- dispatch(authActions.SET_HOME_CLUSTER(homeCluster || config.uuidPrefix));
- if (token && user) {
- dispatch(authActions.INIT({ user, token }));
- dispatch<any>(initSessions(services.authService, config, user));
- dispatch<any>(getUserDetails()).then((user: User) => {
- dispatch(authActions.INIT({ user, token }));
- }).catch((err: AxiosError) => {
- if (err.response) {
- // Bad token
- if (err.response.status === 401) {
- logout()(dispatch, getState, services);
- }
- }
- });
+ let homeCluster = services.authService.getHomeCluster();
+ if (homeCluster && !config.remoteHosts[homeCluster]) {
+ homeCluster = undefined;