From 603ab9ac280943b65443f1dda692646f06fbc2be Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Fri, 20 Aug 2021 00:06:05 -0300 Subject: [PATCH 1/2] Topgear - Login redirect to previous page --- 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 81a50e7d5e..5bcb069898 100644 --- a/src/shared/containers/tc-communities/Loader.jsx +++ b/src/shared/containers/tc-communities/Loader.jsx @@ -42,20 +42,21 @@ class Loader extends React.Component { visitorGroups, } = this.props; + const returnUrl = encodeURIComponent(window.location.href); + if (!loadingMeta && ( !meta /* || (Date.now() - meta.timestamp) > MAXAGE */ )) nextProps.loadMetaData(communityId, tokenV3); /* TODO: This is a hacky way to handle SSO authentication for TopGear */ if (communityId === 'comcast' && !visitorGroups) { - const returnUrl = encodeURIComponent(window.location.href); window.location = `${config.URL.AUTH}/member?retUrl=${returnUrl}&utm_source=${communityId}`; } /* 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}`; + window.location = `${config.URL.AUTH}/?retUrl=${returnUrl}&utm_source=${communityId}`; } else if (window.location.pathname === '/' || window.location.pathname === '/__community__/wipro') { window.location = config.URL.TOPGEAR; } From 408ba94ee88906da563dddd4cdd0e5ef8dacf22f Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Fri, 20 Aug 2021 00:07:38 -0300 Subject: [PATCH 2/2] ci: Deploy topgear-challenge-redirect to Dev and Stag env --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 08fe8813f1..c8792e1188 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -343,7 +343,7 @@ workflows: branches: only: - develop - - fix-challenge-end-date + - topgear-challenge-redirect # This is alternate dev env for parallel testing - "build-test": context : org-global @@ -372,7 +372,7 @@ workflows: branches: only: - develop - - fix-challenge-end-date + - topgear-challenge-redirect # Production builds are exectuted # when PR is merged to the master # Don't change anything in this configuration