const sessions = authService.buildSessions(config, user);
authService.saveSessions(sessions);
dispatch(authActions.SET_SESSIONS(sessions));
+ dispatch(validateSessions());
};
export const loadSiteManagerPanel = () =>
const remoteConfig = new Config();
remoteConfig.uuidPrefix = response.data.ClusterID;
remoteConfig.workbench2Url = response.data.Services.Workbench2.ExternalURL;
+ remoteConfig.loginCluster = response.data.Login.LoginCluster;
mapRemoteHosts(response.data, remoteConfig);
dispatch(authActions.REMOTE_CLUSTER_CONFIG({ config: remoteConfig }));
});
};
export const login = (uuidPrefix: string, homeCluster: string, loginCluster: string,
- remoteHosts: { [key: string]: string }) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
- services.authService.login(uuidPrefix, homeCluster, loginCluster, remoteHosts);
- dispatch(authActions.LOGIN());
-};
+ remoteHosts: { [key: string]: string }) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ services.authService.login(uuidPrefix, homeCluster, loginCluster, remoteHosts);
+ dispatch(authActions.LOGIN());
+ };
export const logout = (deleteLinkData: boolean = false) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
if (deleteLinkData) {
export const SearchResultsPanelView = (props: SearchResultsPanelProps) => {
const homeCluster = props.user.uuid.substr(0, 5);
+ const loggedIn = props.sessions.filter((ss) => ss.loggedIn);
return <DataExplorer
id={SEARCH_RESULTS_PANEL_ID}
onRowClick={props.onItemClick}
contextMenuColumn={false}
hideSearchInput
title={
- props.localCluster === homeCluster ?
- <div>Searching clusters: {props.sessions.filter((ss) => ss.loggedIn).map((ss) => <span key={ss.clusterId}> {ss.clusterId}</span>)}</div> :
- <div>Searching local cluster {props.localCluster} only. To search multiple clusters, <a href={props.remoteHostsConfig[homeCluster] && props.remoteHostsConfig[homeCluster].workbench2Url}> start from your home Workbench.</a></div>
+ (props.localCluster !== homeCluster && loggedIn.length === 1) ?
+ <div>Searching local cluster {props.localCluster} only. To search multiple clusters, <a href={props.remoteHostsConfig[homeCluster] && props.remoteHostsConfig[homeCluster].workbench2Url}> start from your home Workbench.</a></div> :
+ <div>Searching clusters: {loggedIn.map((ss) => <span key={ss.clusterId}> {ss.clusterId}</span>)}</div>
}
/>;
};
console.log(`Cluster ${k} does not define workbench2Url. Federated login / cross-site linking to ${k} is unavailable. Tell the admin of ${k} to set Services->Workbench2->ExternalURL in config.yml.`);
return;
}
- return <iframe key={k} src={`${remoteHostsConfig[k].workbench2Url}/fedtoken?api_token=${getSaltedToken(k, tokenUuid, token)}`} style={{
+ const fedtoken = (remoteHostsConfig[k].loginCluster === localCluster)
+ ? apiToken : getSaltedToken(k, tokenUuid, token);
+ return <iframe key={k} src={`${remoteHostsConfig[k].workbench2Url}/fedtoken?api_token=${fedtoken}`} style={{
height: 0,
width: 0,
visibility: "hidden"