LOGOUT: ofType<{ deleteLinkData: boolean }>(),
SET_CONFIG: ofType<{ config: Config }>(),
SET_EXTRA_TOKEN: ofType<{ extraApiToken: string, extraApiTokenExpiration?: Date }>(),
+ RESET_EXTRA_TOKEN: {},
INIT_USER: ofType<{ user: User, token: string, tokenExpiration?: Date }>(),
USER_DETAILS_REQUEST: {},
USER_DETAILS_SUCCESS: ofType<User>(),
extraApiTokenExpiration: client.expiresAt ? new Date(client.expiresAt): undefined,
}));
return extraToken;
- } catch (e) { }
+ } catch (e) {
+ dispatch(authActions.RESET_EXTRA_TOKEN());
+ }
}
const user = getState().auth.user;
const loginCluster = getState().auth.config.clusterConfig.Login.LoginCluster;
}),
SET_EXTRA_TOKEN: ({ extraApiToken, extraApiTokenExpiration }) =>
({ ...state, extraApiToken, extraApiTokenExpiration }),
+ RESET_EXTRA_TOKEN: () =>
+ ({ ...state, extraApiToken: undefined, extraApiTokenExpiration: undefined }),
INIT_USER: ({ user, token, tokenExpiration }) =>
({ ...state,
user,