diff --git a/.circleci/config.yml b/.circleci/config.yml index 968598bb1c..a5c743987e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -341,6 +341,7 @@ workflows: branches: only: - develop + - topgear-login-redirect # This is alternate dev env for parallel testing - "build-test": context : org-global @@ -361,7 +362,7 @@ workflows: filters: branches: only: - - thrive-bug-fixes2 + - free # This is stage env for production QA releases - "build-prod-staging": context : org-global @@ -369,6 +370,7 @@ workflows: branches: only: - develop + - topgear-login-redirect # Production builds are exectuted # when PR is merged to the master # Don't change anything in this configuration diff --git a/src/shared/containers/tc-communities/Loader.jsx b/src/shared/containers/tc-communities/Loader.jsx index ca1f672afa..81a50e7d5e 100644 --- a/src/shared/containers/tc-communities/Loader.jsx +++ b/src/shared/containers/tc-communities/Loader.jsx @@ -46,21 +46,19 @@ class Loader extends React.Component { !meta /* || (Date.now() - meta.timestamp) > MAXAGE */ )) nextProps.loadMetaData(communityId, tokenV3); - /* TODO: This is a hacky way to handle SSO authentication for TopGear - * (Wipro) and Zurich community visitors. Should be re-factored, but not it is not - * clear, what exactly do we need to support it in general. */ - if ((communityId === 'wipro' || communityId === 'comcast') && !visitorGroups) { + /* TODO: This is a hacky way to handle SSO authentication for TopGear */ + if (communityId === 'comcast' && !visitorGroups) { const returnUrl = encodeURIComponent(window.location.href); - if (communityId === 'wipro') { - window.location = `${config.URL.AUTH}/?retUrl=${config.URL.TOPGEAR}`; - } window.location = `${config.URL.AUTH}/member?retUrl=${returnUrl}&utm_source=${communityId}`; } - /* Redirect odl TopGear home to new TopGear App */ - if (communityId === 'wipro' - && (window.location.pathname === '/' || window.location.pathname === '/__community__/wipro')) { - window.location = config.URL.TOPGEAR; + /* Redirect old TopGear home to new TopGear App and login redirect */ + if (communityId === 'wipro') { + if (!visitorGroups) { + window.location = `${config.URL.AUTH}/?retUrl=${config.URL.TOPGEAR}&utm_source=${communityId}`; + } else if (window.location.pathname === '/' || window.location.pathname === '/__community__/wipro') { + window.location = config.URL.TOPGEAR; + } } }