- .filter((k) => k !== auth.homeCluster)
- .map((k) => <iframe key={k} src={"https://" + remoteHostsConfig[k].workbench2Url} style={{ visibility: "hidden" }} />)}
+ .map((k) => {
+ if (k === localCluster) {
+ return;
+ }
+ if (!remoteHostsConfig[k].workbench2Url) {
+ 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;
+ }
+ const fedtoken = (remoteHostsConfig[k].loginCluster === localCluster)
+ ? apiToken : getSaltedToken(k, apiToken);
+ return <iframe key={k} src={`${remoteHostsConfig[k].workbench2Url}/fedtoken?api_token=${fedtoken}`} style={{
+ height: 0,
+ width: 0,
+ visibility: "hidden"
+ }}
+ />;
+ })}