Skip to content

Commit 8ccbd1c

Browse files
Merge pull request #5579 from topcoder-platform/topgear-login-redirect
Topgear login redirect
2 parents 83e0bbf + 0d96856 commit 8ccbd1c

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

.circleci/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ workflows:
341341
branches:
342342
only:
343343
- develop
344+
- topgear-login-redirect
344345
# This is alternate dev env for parallel testing
345346
- "build-test":
346347
context : org-global
@@ -361,14 +362,15 @@ workflows:
361362
filters:
362363
branches:
363364
only:
364-
- thrive-bug-fixes2
365+
- free
365366
# This is stage env for production QA releases
366367
- "build-prod-staging":
367368
context : org-global
368369
filters: &filters-staging
369370
branches:
370371
only:
371372
- develop
373+
- topgear-login-redirect
372374
# Production builds are exectuted
373375
# when PR is merged to the master
374376
# Don't change anything in this configuration

src/shared/containers/tc-communities/Loader.jsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,19 @@ class Loader extends React.Component {
4646
!meta /* || (Date.now() - meta.timestamp) > MAXAGE */
4747
)) nextProps.loadMetaData(communityId, tokenV3);
4848

49-
/* TODO: This is a hacky way to handle SSO authentication for TopGear
50-
* (Wipro) and Zurich community visitors. Should be re-factored, but not it is not
51-
* clear, what exactly do we need to support it in general. */
52-
if ((communityId === 'wipro' || communityId === 'comcast') && !visitorGroups) {
49+
/* TODO: This is a hacky way to handle SSO authentication for TopGear */
50+
if (communityId === 'comcast' && !visitorGroups) {
5351
const returnUrl = encodeURIComponent(window.location.href);
54-
if (communityId === 'wipro') {
55-
window.location = `${config.URL.AUTH}/?retUrl=${config.URL.TOPGEAR}`;
56-
}
5752
window.location = `${config.URL.AUTH}/member?retUrl=${returnUrl}&utm_source=${communityId}`;
5853
}
5954

60-
/* Redirect odl TopGear home to new TopGear App */
61-
if (communityId === 'wipro'
62-
&& (window.location.pathname === '/' || window.location.pathname === '/__community__/wipro')) {
63-
window.location = config.URL.TOPGEAR;
55+
/* Redirect old TopGear home to new TopGear App and login redirect */
56+
if (communityId === 'wipro') {
57+
if (!visitorGroups) {
58+
window.location = `${config.URL.AUTH}/?retUrl=${config.URL.TOPGEAR}&utm_source=${communityId}`;
59+
} else if (window.location.pathname === '/' || window.location.pathname === '/__community__/wipro') {
60+
window.location = config.URL.TOPGEAR;
61+
}
6462
}
6563
}
6664

0 commit comments

Comments
 (0)