From ba9542847d13a5830c03dc29a777988a5cbb498c Mon Sep 17 00:00:00 2001 From: Thanh Nguyen Date: Mon, 29 Jan 2018 16:28:47 -0600 Subject: [PATCH] fix(label): shibbleth to nih --- data/getSchema.js | 2 +- src/actions.js | 4 ++-- src/index.ejs | 2 +- src/localconf.js | 19 +++++++++++++++++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/data/getSchema.js b/data/getSchema.js index 3768e11dc8..b2113c4a6a 100755 --- a/data/getSchema.js +++ b/data/getSchema.js @@ -18,7 +18,7 @@ const { gdcSubPath } = (function () { if (process.argv.length < 3) { let gdcDefaultPath = process.env.HOSTNAME ? `https://${process.env.HOSTNAME}/api/v0/submission/` : 'http://localhost:5000/v0/submission/'; - if (gdcDefaultPath.startsWith('revproxy')) { + if (process.env.HOSTNAME.startsWith('revproxy')) { gdcDefaultPath = `http://${process.env.HOSTNAME}/api/v0/submission/` } return { status: 'ok', gdcSubPath: addSlash(process.env.GDC_SUBPATH || gdcDefaultPath) }; diff --git a/src/actions.js b/src/actions.js index dfe35c7756..542e1c580c 100644 --- a/src/actions.js +++ b/src/actions.js @@ -39,7 +39,7 @@ export const fetchJsonOrText = (opts) => { return Promise.resolve({ status: 200, data: JSON.parse(fetchCache[path]) }); } const request = { - credentials: 'same-origin', + credentials: 'include', headers: { ...headers, ...customHeaders }, method, body, @@ -96,7 +96,7 @@ export const fetchWrapper = ({ path, method = 'GET', body = null, customHeaders, export const fetchGraphQL = (graphQLParams) => { const request = { - credentials: 'same-origin', + credentials: 'include', headers: { ...headers }, method: 'POST', body: JSON.stringify(graphQLParams), diff --git a/src/index.ejs b/src/index.ejs index 289c38cd72..f4de9f0c3a 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -2,7 +2,7 @@ - + diff --git a/src/localconf.js b/src/localconf.js index f7b31a7713..4b0c16cbbd 100644 --- a/src/localconf.js +++ b/src/localconf.js @@ -24,13 +24,13 @@ function buildConfig(opts) { const { dev, mockStore, app, basename, hostname } = Object.assign({}, defaults, opts); - let userapiPath = `${hostname}user/`; const submissionApiPath = `${hostname}api/v0/submission/`; const apiPath = `${hostname}api/`; const submissionApiOauthPath = `${hostname}api/v0/oauth2/`; // let credentialOauthPath = `${hostname}middleware/oauth2/v0/`; - const credentialCdisPath = `${userapiPath}credentials/cdis/`; const graphqlPath = `${hostname}api/v0/submission/graphql/`; + let userapiPath = `${hostname}user/`; + let credentialCdisPath = `${userapiPath}credentials/cdis/`; let login = { url: `${userapiPath}login/google?redirect=`, title: 'Login from Google', @@ -131,6 +131,21 @@ function buildConfig(opts) { { icon: 'face', link: '/identity', color: '#daa520', name: 'profile' }, { icon: 'content_copy', link: '/files', color: '#a2a2a2', name: 'data' }, ]; + } else if (app === 'genomel') { + appname = 'GenoMEL Data Commons Portal'; + const userapiPathOut = 'https://login.bionimbus.org/'; + credentialCdisPath = `${userapiPath}credentials/cdis/`; + login = { + url: `${userapiPathOut}login/shib?redirect=`, + title: 'Login from NIH', + }; + navItems = [ + { icon: 'home', link: '/', color: '#a2a2a2', name: 'home' }, + { icon: 'search', link: '/query', color: '#daa520', name: 'query' }, + { icon: 'class', link: '/DD', color: '#a2a2a2', name: 'dictionary' }, + { icon: 'face', link: '/identity', color: '#daa520', name: 'profile' }, + { icon: 'content_copy', link: '/files', color: '#a2a2a2', name: 'data' }, + ]; } else if (app === 'gdc') { userapiPath = dev === true ? `${hostname}user/` : `${hostname}api/`; // credentialPath = `${userapiPath}credentials/cleversafe/`;