X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/fd470d8f7838b57777492289e6e4195b6c39bd2e..6ead1b122e52a587963383f6a15edf6dfc166ef6:/src/views/workbench/fed-login.tsx

diff --git a/src/views/workbench/fed-login.tsx b/src/views/workbench/fed-login.tsx
index 399b419eed..c64778a3c8 100644
--- a/src/views/workbench/fed-login.tsx
+++ b/src/views/workbench/fed-login.tsx
@@ -13,7 +13,7 @@ import { Config } from '~/common/config';
 export interface FedLoginProps {
     user?: User;
     apiToken?: string;
-    homeCluster: string;
+    localCluster: string;
     remoteHostsConfig: { [key: string]: Config };
 }
 
@@ -21,26 +21,34 @@ const mapStateToProps = ({ auth }: RootState) => ({
     user: auth.user,
     apiToken: auth.apiToken,
     remoteHostsConfig: auth.remoteHostsConfig,
-    homeCluster: auth.homeCluster,
+    localCluster: auth.localCluster,
 });
 
 export const FedLogin = connect(mapStateToProps)(
     class extends React.Component<FedLoginProps> {
         render() {
-            const { apiToken, user, homeCluster, remoteHostsConfig } = this.props;
-            if (!apiToken || !user || !user.uuid.startsWith(homeCluster)) {
+            const { apiToken, user, localCluster, remoteHostsConfig } = this.props;
+            if (!apiToken || !user || !user.uuid.startsWith(localCluster)) {
                 return <></>;
             }
             const [, tokenUuid, token] = apiToken.split("/");
             return <div id={"fedtoken-iframe-div"}>
                 {Object.keys(remoteHostsConfig)
-                    .map((k) => k !== homeCluster &&
-                        <iframe key={k} src={`${remoteHostsConfig[k].workbench2Url}/fedtoken?api_token=${getSaltedToken(k, tokenUuid, token)}`} style={{
+                    .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;
+                        }
+                        return <iframe key={k} src={`${remoteHostsConfig[k].workbench2Url}/fedtoken?api_token=${getSaltedToken(k, tokenUuid, token)}`} style={{
                             height: 0,
                             width: 0,
                             visibility: "hidden"
                         }}
-                        />)}
+                        />;
+                    })}
             </div>;
         }
     });
