From 7513754d31c27b6d8482d3693e15a0c25cddab80 Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Thu, 10 Jun 2021 16:15:17 -0300 Subject: [PATCH 1/3] Fix TopGear login redirect link --- src/shared/containers/tc-communities/Loader.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shared/containers/tc-communities/Loader.jsx b/src/shared/containers/tc-communities/Loader.jsx index ca1f672afa..c82bba6f16 100644 --- a/src/shared/containers/tc-communities/Loader.jsx +++ b/src/shared/containers/tc-communities/Loader.jsx @@ -52,9 +52,10 @@ class Loader extends React.Component { if ((communityId === 'wipro' || 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}/?retUrl=${config.URL.TOPGEAR}&utm_source=${communityId}`; + } else { + window.location = `${config.URL.AUTH}/member?retUrl=${returnUrl}&utm_source=${communityId}`; } - window.location = `${config.URL.AUTH}/member?retUrl=${returnUrl}&utm_source=${communityId}`; } /* Redirect odl TopGear home to new TopGear App */ From 3a10df63c7b826b5c77debeea37c0463640e38e5 Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Thu, 10 Jun 2021 16:16:18 -0300 Subject: [PATCH 2/3] ci: Deploy topgear-login-redirect to Dev and Stag --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 From 0d96856d0fd89855c36ca61664ef45655e6eef46 Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Fri, 11 Jun 2021 00:12:17 -0300 Subject: [PATCH 3/3] TopGear - Update home redirect to not logged user --- .../containers/tc-communities/Loader.jsx | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/shared/containers/tc-communities/Loader.jsx b/src/shared/containers/tc-communities/Loader.jsx index c82bba6f16..81a50e7d5e 100644 --- a/src/shared/containers/tc-communities/Loader.jsx +++ b/src/shared/containers/tc-communities/Loader.jsx @@ -46,22 +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}&utm_source=${communityId}`; - } else { - window.location = `${config.URL.AUTH}/member?retUrl=${returnUrl}&utm_source=${communityId}`; - } + 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; + } } }