From d7c2300673de6331b9f3e7f4735df831564beeb2 Mon Sep 17 00:00:00 2001 From: pieterlukasse Date: Mon, 19 Sep 2022 17:07:25 +0200 Subject: [PATCH 01/12] centralize WTC refresh token initialization so that the refresh token is initialized/refresh upon login to the portal instead of only IF the user enters into the workspace environment --- src/Workspace/WorkspaceRefreshToken.js | 20 ++++++++++++++++++++ src/Workspace/index.jsx | 15 ++------------- src/index.jsx | 4 ++++ 3 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 src/Workspace/WorkspaceRefreshToken.js diff --git a/src/Workspace/WorkspaceRefreshToken.js b/src/Workspace/WorkspaceRefreshToken.js new file mode 100644 index 0000000000..168aa23f53 --- /dev/null +++ b/src/Workspace/WorkspaceRefreshToken.js @@ -0,0 +1,20 @@ +import { fetchWithCreds } from '../actions'; +import { wtsPath } from '../localconf'; + +// start workspace session for WTS, call optional connectedCallBack if initialized/connected +export const initWorkspaceRefreshToken = (connectedCallBack) => { + console.log('init/renew WTS refresh token...'); + fetchWithCreds({ + path: `${wtsPath}connected`, + method: 'GET', + }) + .then( + ({ status }) => { + if (status !== 200) { + window.location.href = `${wtsPath}/authorization_url?redirect=${window.location.pathname}`; + } else if (connectedCallBack) { + connectedCallBack(); + } + }, + ); + } diff --git a/src/Workspace/index.jsx b/src/Workspace/index.jsx index fb5941ceef..6e13547dc1 100644 --- a/src/Workspace/index.jsx +++ b/src/Workspace/index.jsx @@ -42,6 +42,7 @@ import WorkspaceOption from './WorkspaceOption'; import WorkspaceLogin from './WorkspaceLogin'; import sessionMonitor from '../SessionMonitor'; import workspaceSessionMonitor from './WorkspaceSessionMonitor'; +import { initWorkspaceRefreshToken } from './WorkspaceRefreshToken'; const { Step } = Steps; const { Panel } = Collapse; @@ -73,19 +74,7 @@ class Workspace extends React.Component { } componentDidMount() { - fetchWithCreds({ - path: `${wtsPath}connected`, - method: 'GET', - }) - .then( - ({ status }) => { - if (status !== 200) { - window.location.href = `${wtsPath}/authorization_url?redirect=${window.location.pathname}`; - } else { - this.connected(); - } - }, - ); + initWorkspaceRefreshToken(this.connected); } componentWillUnmount() { diff --git a/src/index.jsx b/src/index.jsx index 70044cb4ee..3cb32fab62 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -66,6 +66,10 @@ import ErrorWorkspacePlaceholder from './Workspace/ErrorWorkspacePlaceholder'; import { ReduxStudyViewer, ReduxSingleStudyViewer } from './StudyViewer/reduxer'; import NotFound from './components/NotFound'; import ErrorPage403 from './components/ErrorPage403'; +import { initWorkspaceRefreshToken } from './Workspace/WorkspaceRefreshToken'; + +// start workspace session for WTS +initWorkspaceRefreshToken(); // monitor user's session sessionMonitor.start(); From bed5ae7e99086e10d1403115a0d501a6d42a7891 Mon Sep 17 00:00:00 2001 From: pieterlukasse Date: Mon, 19 Sep 2022 17:08:11 +0200 Subject: [PATCH 02/12] remove unnecessary call to authorization_url --- .../wizardEndpoints/cohortMiddlewareApi.js | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/Analysis/GWASWizard/wizardEndpoints/cohortMiddlewareApi.js b/src/Analysis/GWASWizard/wizardEndpoints/cohortMiddlewareApi.js index 6f563a32db..603f6add2b 100644 --- a/src/Analysis/GWASWizard/wizardEndpoints/cohortMiddlewareApi.js +++ b/src/Analysis/GWASWizard/wizardEndpoints/cohortMiddlewareApi.js @@ -188,24 +188,12 @@ export const fetchSources = async () => { export const useSourceFetch = () => { const [loading, setLoading] = useState(true); const [sourceId, setSourceId] = useState(undefined); - const getSources = () => { // do wts login and fetch sources on initialization - fetchWithCreds({ - path: `${wtsPath}connected`, - method: 'GET', - }) - .then( - (res) => { - if (res.status !== 200) { - window.location.href = `${wtsPath}authorization_url?redirect=${window.location.pathname}`; - } else { - fetchSources().then((data) => { - setSourceId(data.sources[0].source_id); - setLoading(false); - }); - } - }, - ); - }; + const getSources = () => { // fetch sources on initialization + fetchSources().then((data) => { + setSourceId(data.sources[0].source_id); + setLoading(false); + }); + } useEffect(() => { getSources(); }, []); From ad5c8ec8613eab0c147a4b066e7b9123b87f404d Mon Sep 17 00:00:00 2001 From: pieterlukasse Date: Tue, 11 Oct 2022 19:41:19 +0200 Subject: [PATCH 03/12] add new feature flag to enable faster refresh of WTS token This is based on the assumption that workspace and WTS are not always bundled together in data portal installations. I.e. one could have a workspace without a WTS. --- docs/portal_config.md | 1 + src/Login/ProtectedContent.jsx | 6 ++++++ src/index.jsx | 4 ---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/portal_config.md b/docs/portal_config.md index e3bcabb1c9..d4087f38c7 100644 --- a/docs/portal_config.md +++ b/docs/portal_config.md @@ -182,6 +182,7 @@ Below is an example, with inline comments describing what each JSON block config "explorerFilterValuesToHide": ["array of strings"], // optional, Values set in array will be hidden in guppy filters. Intended use is to hide missing data category from filters, for this it should be set to the same as `missing_data_alias` in Guppy server config "studyRegistration": true, // optional, whether to enable the study registration feature "workspaceRegistration": true, // optional, whether to enable the workspace registration feature + "workspaceTokenServiceRefreshTokenAtLogin": true, // optional, whether to refresh the WTS token directly at portal login (recommended mode). If not set, this refresh happens only when the user enters the workspace section of the portal (default/old/previous mode). }, "dataExplorerConfig": { // required only if featureFlags.explorer is true; configuration for the Data Explorer (/explorer); can be replaced by explorerConfig, see Multi Tab Explorer doc "charts": { // optional; indicates which charts to display in the Data Explorer diff --git a/src/Login/ProtectedContent.jsx b/src/Login/ProtectedContent.jsx index 0525523ee0..919de68ac1 100644 --- a/src/Login/ProtectedContent.jsx +++ b/src/Login/ProtectedContent.jsx @@ -13,6 +13,8 @@ import ReduxAuthTimeoutPopup from '../Popup/ReduxAuthTimeoutPopup'; import ReduxSystemUseWarningPopup from '../Popup/SystemUseWarningPopup'; import { intersection, isPageFullScreen } from '../utils'; import './ProtectedContent.css'; +import isEnabled from '../helpers/featureFlags'; +import { initWorkspaceRefreshToken } from '../Workspace/WorkspaceRefreshToken'; let lastAuthMs = 0; @@ -70,6 +72,10 @@ class ProtectedContent extends React.Component { const latestState = { ...newState }; latestState.dataLoaded = true; this.setState(latestState); + if (newState.authenticated && isEnabled('workspaceTokenServiceRefreshTokenAtLogin')) { + // initialize WTS: + initWorkspaceRefreshToken(); + } }; return filterPromise.then( finish, finish, diff --git a/src/index.jsx b/src/index.jsx index 3cb32fab62..70044cb4ee 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -66,10 +66,6 @@ import ErrorWorkspacePlaceholder from './Workspace/ErrorWorkspacePlaceholder'; import { ReduxStudyViewer, ReduxSingleStudyViewer } from './StudyViewer/reduxer'; import NotFound from './components/NotFound'; import ErrorPage403 from './components/ErrorPage403'; -import { initWorkspaceRefreshToken } from './Workspace/WorkspaceRefreshToken'; - -// start workspace session for WTS -initWorkspaceRefreshToken(); // monitor user's session sessionMonitor.start(); From d2b0942d6bb39c97493ea8a9b2e80713175b3d8f Mon Sep 17 00:00:00 2001 From: pieterlukasse Date: Thu, 20 Oct 2022 21:15:13 +0200 Subject: [PATCH 04/12] add debounce for WTS refresh call to avoid multiple unnecessary repeated calls to this service in a short time interval. This is based on a similar solution found in `checkLoginStatus` (in `ProtectedContent.jsx`). --- src/Workspace/WorkspaceRefreshToken.js | 37 +++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/Workspace/WorkspaceRefreshToken.js b/src/Workspace/WorkspaceRefreshToken.js index 168aa23f53..44b1fd60f2 100644 --- a/src/Workspace/WorkspaceRefreshToken.js +++ b/src/Workspace/WorkspaceRefreshToken.js @@ -1,20 +1,27 @@ import { fetchWithCreds } from '../actions'; import { wtsPath } from '../localconf'; +let lastRefreshMs = 0; +const debounceMs = 60000; + // start workspace session for WTS, call optional connectedCallBack if initialized/connected export const initWorkspaceRefreshToken = (connectedCallBack) => { - console.log('init/renew WTS refresh token...'); - fetchWithCreds({ - path: `${wtsPath}connected`, - method: 'GET', - }) - .then( - ({ status }) => { - if (status !== 200) { - window.location.href = `${wtsPath}/authorization_url?redirect=${window.location.pathname}`; - } else if (connectedCallBack) { - connectedCallBack(); - } - }, - ); - } + const nowMs = Date.now(); + if (nowMs - lastRefreshMs > debounceMs) { + console.log('init/renew WTS refresh token...'); + fetchWithCreds({ + path: `${wtsPath}connected`, + method: 'GET', + }) + .then( + ({ status }) => { + if (status !== 200) { + window.location.href = `${wtsPath}/authorization_url?redirect=${window.location.pathname}`; + } else if (connectedCallBack) { + connectedCallBack(); + } + }, + ); + lastRefreshMs = Date.now(); + } +} From fa37b6189d314a95ec807a89ab1316595868137a Mon Sep 17 00:00:00 2001 From: pieterlukasse Date: Thu, 20 Oct 2022 21:26:24 +0200 Subject: [PATCH 05/12] check feature flag to avoid extra refresh ...just to avoid unnecessary extra calls to the service --- src/Workspace/index.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Workspace/index.jsx b/src/Workspace/index.jsx index 6e13547dc1..49282107b1 100644 --- a/src/Workspace/index.jsx +++ b/src/Workspace/index.jsx @@ -74,7 +74,12 @@ class Workspace extends React.Component { } componentDidMount() { - initWorkspaceRefreshToken(this.connected); + // Check if workspaceTokenServiceRefreshTokenAtLogin is NOT set. + // Because if is already enabled, then an extra refresh is not + // really needed, since it has already happened at login: + if (!isEnabled('workspaceTokenServiceRefreshTokenAtLogin')) { + initWorkspaceRefreshToken(this.connected); + } } componentWillUnmount() { From 9591d617af06e71e047313c0781b7df029f87ce3 Mon Sep 17 00:00:00 2001 From: pieterlukasse Date: Wed, 2 Nov 2022 20:37:10 +0100 Subject: [PATCH 06/12] use generic getUrlForRedirectLocation in Login and in WTS refresh redirect ...includes fixes for errors reported by eslint --- .../wizardEndpoints/cohortMiddlewareApi.js | 5 +-- src/Login/Login.jsx | 31 +++++++------ src/Login/ProtectedContent.jsx | 5 ++- src/Workspace/WorkspaceRefreshToken.js | 43 ++++++++++--------- src/Workspace/index.jsx | 4 +- 5 files changed, 48 insertions(+), 40 deletions(-) diff --git a/src/Analysis/GWASWizard/wizardEndpoints/cohortMiddlewareApi.js b/src/Analysis/GWASWizard/wizardEndpoints/cohortMiddlewareApi.js index 603f6add2b..87dc766d28 100644 --- a/src/Analysis/GWASWizard/wizardEndpoints/cohortMiddlewareApi.js +++ b/src/Analysis/GWASWizard/wizardEndpoints/cohortMiddlewareApi.js @@ -1,7 +1,6 @@ /* eslint-disable camelcase */ import { useState, useEffect } from 'react'; -import { cohortMiddlewarePath, wtsPath } from '../../../localconf'; -import { fetchWithCreds } from '../../../actions'; +import { cohortMiddlewarePath } from '../../../localconf'; import { headers } from '../../../configs'; import { hareConceptId } from '../shared/constants'; @@ -193,7 +192,7 @@ export const useSourceFetch = () => { setSourceId(data.sources[0].source_id); setLoading(false); }); - } + }; useEffect(() => { getSources(); }, []); diff --git a/src/Login/Login.jsx b/src/Login/Login.jsx index 03725d2b31..eb0be1fb9d 100644 --- a/src/Login/Login.jsx +++ b/src/Login/Login.jsx @@ -10,6 +10,23 @@ import './Login.less'; const getInitialState = (height) => ({ height }); +// Get a url for a given "location" (location object should have at least the .from attribute) +export const getUrlForRedirectLocation = (location) => { + // compose next according to location.from + let next = (location.from) ? `${basename}${location.from}` : basename; + if (location.state && location.state.from) { + next = `${basename}${location.state.from}`; + } + // clean up url: no double slashes + next = next.replace(/\/+/g, '/'); + const queryParams = querystring.parse(location.search ? location.search.replace(/^\?+/, '') : ''); + if (queryParams.next) { + next = basename === '/' ? queryParams.next : basename + queryParams.next; + } + next = next.replace('?request_access', '?request_access_logged_in'); + return next; +}; + const getLoginUrl = (providerLoginUrl, next) => { const queryChar = providerLoginUrl.includes('?') ? '&' : '?'; return `${providerLoginUrl}${queryChar}redirect=${window.location.origin}${next}`; @@ -50,18 +67,7 @@ class Login extends React.Component { render() { const { location } = this.props; // this is the react-router "location" - // compose next according to location.from - let next = (location.from) ? `${basename}${location.from}` : basename; - if (location.state && location.state.from) { - next = `${basename}${location.state.from}`; - } - // clean up url: no double slashes - next = next.replace(/\/+/g, '/'); - const queryParams = querystring.parse(location.search ? location.search.replace(/^\?+/, '') : ''); - if (queryParams.next) { - next = basename === '/' ? queryParams.next : basename + queryParams.next; - } - + const next = getUrlForRedirectLocation(location); let customImage = 'gene'; let displaySideBoxImages = true; if (components.login && components.login.image !== undefined) { @@ -72,7 +78,6 @@ class Login extends React.Component { } } const customImageStyle = { backgroundImage: `url(/src/img/icons/${customImage}.svg)` }; - next = next.replace('?request_access', '?request_access_logged_in'); let loginComponent = ( diff --git a/src/Login/ProtectedContent.jsx b/src/Login/ProtectedContent.jsx index 919de68ac1..ec23567e9a 100644 --- a/src/Login/ProtectedContent.jsx +++ b/src/Login/ProtectedContent.jsx @@ -73,8 +73,9 @@ class ProtectedContent extends React.Component { latestState.dataLoaded = true; this.setState(latestState); if (newState.authenticated && isEnabled('workspaceTokenServiceRefreshTokenAtLogin')) { - // initialize WTS: - initWorkspaceRefreshToken(); + // initialize WTS: + const { location } = this.props; // this is the react-router "location" + initWorkspaceRefreshToken(location); } }; return filterPromise.then( diff --git a/src/Workspace/WorkspaceRefreshToken.js b/src/Workspace/WorkspaceRefreshToken.js index 44b1fd60f2..cce885a0e6 100644 --- a/src/Workspace/WorkspaceRefreshToken.js +++ b/src/Workspace/WorkspaceRefreshToken.js @@ -1,27 +1,30 @@ import { fetchWithCreds } from '../actions'; import { wtsPath } from '../localconf'; +import { getUrlForRedirectLocation } from '../Login/Login'; let lastRefreshMs = 0; const debounceMs = 60000; // start workspace session for WTS, call optional connectedCallBack if initialized/connected -export const initWorkspaceRefreshToken = (connectedCallBack) => { - const nowMs = Date.now(); - if (nowMs - lastRefreshMs > debounceMs) { - console.log('init/renew WTS refresh token...'); - fetchWithCreds({ - path: `${wtsPath}connected`, - method: 'GET', - }) - .then( - ({ status }) => { - if (status !== 200) { - window.location.href = `${wtsPath}/authorization_url?redirect=${window.location.pathname}`; - } else if (connectedCallBack) { - connectedCallBack(); - } - }, - ); - lastRefreshMs = Date.now(); - } -} +/* eslint-disable import/prefer-default-export */ +export const initWorkspaceRefreshToken = (redirectLocation, connectedCallBack) => { + const redirectUrl = getUrlForRedirectLocation(redirectLocation); + const nowMs = Date.now(); + if (nowMs - lastRefreshMs > debounceMs) { + console.log('init/renew WTS refresh token...'); + fetchWithCreds({ + path: `${wtsPath}connected`, + method: 'GET', + }) + .then( + ({ status }) => { + if (status !== 200) { + window.location.href = `${wtsPath}/authorization_url?redirect=${redirectUrl}`; + } else if (connectedCallBack) { + connectedCallBack(); + } + }, + ); + lastRefreshMs = Date.now(); + } +}; diff --git a/src/Workspace/index.jsx b/src/Workspace/index.jsx index 49282107b1..bd3e4875a5 100644 --- a/src/Workspace/index.jsx +++ b/src/Workspace/index.jsx @@ -15,7 +15,6 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import isEnabled from '../helpers/featureFlags'; import { workspaceUrl, - wtsPath, externalLoginOptionsUrl, workspaceOptionsUrl, workspaceLaunchUrl, @@ -78,7 +77,8 @@ class Workspace extends React.Component { // Because if is already enabled, then an extra refresh is not // really needed, since it has already happened at login: if (!isEnabled('workspaceTokenServiceRefreshTokenAtLogin')) { - initWorkspaceRefreshToken(this.connected); + const redirectLocation = { from: window.location.pathname }; + initWorkspaceRefreshToken(redirectLocation, this.connected); } } From b3bdc399d77904204077b50cabb80a15dc86e718 Mon Sep 17 00:00:00 2001 From: pieterlukasse Date: Thu, 3 Nov 2022 16:02:05 +0100 Subject: [PATCH 07/12] try to fix issue pointed out by snyk --- src/Login/Login.jsx | 2 +- src/Workspace/index.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Login/Login.jsx b/src/Login/Login.jsx index eb0be1fb9d..d07cb7c5f9 100644 --- a/src/Login/Login.jsx +++ b/src/Login/Login.jsx @@ -24,7 +24,7 @@ export const getUrlForRedirectLocation = (location) => { next = basename === '/' ? queryParams.next : basename + queryParams.next; } next = next.replace('?request_access', '?request_access_logged_in'); - return next; + return `${next}`; }; const getLoginUrl = (providerLoginUrl, next) => { diff --git a/src/Workspace/index.jsx b/src/Workspace/index.jsx index bd3e4875a5..96f6b4a34f 100644 --- a/src/Workspace/index.jsx +++ b/src/Workspace/index.jsx @@ -77,7 +77,7 @@ class Workspace extends React.Component { // Because if is already enabled, then an extra refresh is not // really needed, since it has already happened at login: if (!isEnabled('workspaceTokenServiceRefreshTokenAtLogin')) { - const redirectLocation = { from: window.location.pathname }; + const redirectLocation = { from: `${window.location.pathname}` }; initWorkspaceRefreshToken(redirectLocation, this.connected); } } From 73093a203b87be679304bbda1c0c247026bc744d Mon Sep 17 00:00:00 2001 From: Mingfei Shao <2475897+mfshao@users.noreply.github.com> Date: Fri, 4 Nov 2022 11:49:06 -0500 Subject: [PATCH 08/12] add some validation for redirectUrl ...also to satisfy Snyk Co-authored-by: pieterlukasse --- src/Login/Login.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Login/Login.jsx b/src/Login/Login.jsx index d07cb7c5f9..c1908bc8d5 100644 --- a/src/Login/Login.jsx +++ b/src/Login/Login.jsx @@ -23,6 +23,12 @@ export const getUrlForRedirectLocation = (location) => { if (queryParams.next) { next = basename === '/' ? queryParams.next : basename + queryParams.next; } + const regexp = /^\/.*/gi; + const isValidRedirect = new RegExp(regexp).test(next); + if (!isValidRedirect) { + console.log(`Found illegal "next" parameter value ${next}`); + return basename; + } next = next.replace('?request_access', '?request_access_logged_in'); return `${next}`; }; From c829aeefe3b9d942f6130c62b18e72ad58d0744a Mon Sep 17 00:00:00 2001 From: Mingfei Shao <2475897+mfshao@users.noreply.github.com> Date: Mon, 7 Nov 2022 15:27:25 -0600 Subject: [PATCH 09/12] fix state update (#1134) * fix state update * update --- src/Login/ProtectedContent.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Login/ProtectedContent.jsx b/src/Login/ProtectedContent.jsx index ec23567e9a..cc6c87c986 100644 --- a/src/Login/ProtectedContent.jsx +++ b/src/Login/ProtectedContent.jsx @@ -29,8 +29,8 @@ let lastAuthMs = 0; * @param filter {() => Promise} optional filter to apply before rendering the child component */ class ProtectedContent extends React.Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.state = { authenticated: false, dataLoaded: false, @@ -58,8 +58,8 @@ class ProtectedContent extends React.Component { ) .then( () => this.checkLoginStatus(store, this.state) - .then((newState) => this.props.public || this.checkQuizStatus(newState)) - .then((newState) => this.props.public || this.checkApiToken(store, newState)), + .then((newState) => ((this.props.public) ? { ...newState, redirectTo: null } : this.checkQuizStatus(newState))) // don't redirect for public pages + .then((newState) => ((this.props.public) ? { ...newState, redirectTo: null } : this.checkApiToken(store, newState))), ) .then( (newState) => { From 90fcedcd7ad3d906ca3d80bf4e538540c1ea7894 Mon Sep 17 00:00:00 2001 From: pieterlukasse Date: Tue, 8 Nov 2022 16:42:54 +0100 Subject: [PATCH 10/12] Update src/Workspace/index.jsx Co-authored-by: Mingfei Shao <2475897+mfshao@users.noreply.github.com> --- src/Workspace/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Workspace/index.jsx b/src/Workspace/index.jsx index 96f6b4a34f..0bf66fee0a 100644 --- a/src/Workspace/index.jsx +++ b/src/Workspace/index.jsx @@ -75,7 +75,7 @@ class Workspace extends React.Component { componentDidMount() { // Check if workspaceTokenServiceRefreshTokenAtLogin is NOT set. // Because if is already enabled, then an extra refresh is not - // really needed, since it has already happened at login: + // really needed, since it has already happened at login, so just call the callback: if (!isEnabled('workspaceTokenServiceRefreshTokenAtLogin')) { const redirectLocation = { from: `${window.location.pathname}` }; initWorkspaceRefreshToken(redirectLocation, this.connected); From 7c3266f94c2a8ebf97334b41c460327bc366ec56 Mon Sep 17 00:00:00 2001 From: pieterlukasse Date: Tue, 8 Nov 2022 16:43:04 +0100 Subject: [PATCH 11/12] Update src/Workspace/index.jsx Co-authored-by: Mingfei Shao <2475897+mfshao@users.noreply.github.com> --- src/Workspace/index.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Workspace/index.jsx b/src/Workspace/index.jsx index 0bf66fee0a..306ef5a624 100644 --- a/src/Workspace/index.jsx +++ b/src/Workspace/index.jsx @@ -79,6 +79,8 @@ class Workspace extends React.Component { if (!isEnabled('workspaceTokenServiceRefreshTokenAtLogin')) { const redirectLocation = { from: `${window.location.pathname}` }; initWorkspaceRefreshToken(redirectLocation, this.connected); + } else { + this.connected() } } From 0c0e5464093add067d78fd200df620d078b83d56 Mon Sep 17 00:00:00 2001 From: Sai Shanmukha Narumanchi Date: Tue, 15 Nov 2022 13:03:33 -0600 Subject: [PATCH 12/12] Adding a semi-colon;; (#1137) * Adding logs to see what's going on in workspace index * Remove additional console log --- src/Workspace/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Workspace/index.jsx b/src/Workspace/index.jsx index 306ef5a624..c279c9e06e 100644 --- a/src/Workspace/index.jsx +++ b/src/Workspace/index.jsx @@ -80,7 +80,7 @@ class Workspace extends React.Component { const redirectLocation = { from: `${window.location.pathname}` }; initWorkspaceRefreshToken(redirectLocation, this.connected); } else { - this.connected() + this.connected(); } }