Skip to content

Commit a393eaa

Browse files
Merge pull request #5137 from topcoder-platform/issue-5126
Fix Logout retUrl to all sub-communities
2 parents 3ecec98 + c6881a2 commit a393eaa

File tree

7 files changed

+24
-2
lines changed

7 files changed

+24
-2
lines changed

config/default.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ module.exports = {
119119
BLOCKCHAIN: 'https://blockchain.topcoder-dev.com',
120120
COGNITIVE: 'https://cognitive.topcoder-dev.com',
121121
ZURICH: 'https://community-app.topcoder-dev.com/__community__/zurich',
122+
COMCAST: 'https://community-app.topcoder-dev.com/__community__/comcast',
123+
CS: 'https://community-app.topcoder-dev.com/__community__/cs',
122124
},
123125

124126
/* Dedicated section to group together links to various articles in

config/production.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ module.exports = {
5151
BLOCKCHAIN: 'https://blockchain.topcoder.com',
5252
COGNITIVE: 'https://cognitive.topcoder.com',
5353
ZURICH: 'https://zurich.topcoder.com',
54+
COMCAST: 'https://comcast.topcoder.com',
55+
CS: 'https://cs.topcoder.com',
5456
},
5557
EMAIL_VERIFY_URL: 'http://www.topcoder.com/settings/account/changeEmail',
5658
},

src/shared/components/tc-communities/Header/index.jsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ import DesktopSubMenu from 'components/TopcoderHeader/desktop/SubMenu';
1212
import React from 'react';
1313
import PT from 'prop-types';
1414
import { Avatar, PrimaryButton, Button } from 'topcoder-react-ui-kit';
15-
import { config, Link, NavLink } from 'topcoder-react-utils';
15+
import {
16+
config,
17+
Link,
18+
NavLink,
19+
isomorphy,
20+
} from 'topcoder-react-utils';
1621
import { getRatingColor } from 'utils/tc';
1722
import Dropdown from 'components/tc-communities/Dropdown';
1823
import { themr } from 'react-css-super-themr';
@@ -47,10 +52,13 @@ function Header(props) {
4752
onMobileToggleClick,
4853
profile,
4954
theme,
50-
logoutRedirect,
5155
meta,
5256
} = props;
5357

58+
let {
59+
logoutRedirect,
60+
} = props;
61+
5462
const BASE_URL = config.URL.BASE;
5563
const AUTH_URL = config.URL.AUTH;
5664
const normalizedProfile = profile && _.clone(profile);
@@ -59,6 +67,10 @@ function Header(props) {
5967
meta.competitorsGroupIds,
6068
) : [];
6169

70+
if (_.isEmpty(logoutRedirect) && isomorphy.isClientSide()) {
71+
logoutRedirect = window.location.href;
72+
}
73+
6274
let userSubMenu;
6375
if (profile) {
6476
userSubMenu = {

src/shared/routes/Communities/Blockchain/Routes.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export default function Blockchain({ base, member, meta }) {
5757
baseUrl={base}
5858
hideJoinNow
5959
pageId={match.params.pageId || 'home'}
60+
logoutRedirect={config.URL.COMMUNITIES.BLOCKCHAIN}
6061
/>
6162
<Switch>
6263
<Route

src/shared/routes/Communities/CS/Routes.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import Settings from 'routes/Settings';
2323
import theme from 'components/tc-communities/communities/cs/theme';
2424
import { ThemeProvider } from 'react-css-super-themr';
2525
import { Route, Switch } from 'react-router-dom';
26+
import { config } from 'topcoder-react-utils';
2627

2728
import Leaderboard from '../Leaderboard';
2829

@@ -35,6 +36,7 @@ export default function CS({ base, meta }) {
3536
<Header
3637
baseUrl={base}
3738
pageId={match.params.pageId || 'home'}
39+
logoutRedirect={config.URL.COMMUNITIES.CS}
3840
/>
3941
<Switch>
4042
<Route

src/shared/routes/Communities/Cognitive/Routes.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export default function Cognitive({ base, member, meta }) {
4040
<Header
4141
baseUrl={base}
4242
pageId={match.params.pageId || 'home'}
43+
logoutRedirect={config.URL.COMMUNITIES.COGNITIVE}
4344
/>
4445
<Switch>
4546
<Route

src/shared/routes/Communities/Comcast/Routes.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import theme from 'components/tc-communities/communities/comcast/theme';
1919
import { ThemeProvider } from 'react-css-super-themr';
2020
import { Route, Switch } from 'react-router-dom';
2121
import ContentfulRoute from 'components/Contentful/Route';
22+
import { config } from 'topcoder-react-utils';
2223

2324
export default function CS({ base, meta }) {
2425
return (
@@ -29,6 +30,7 @@ export default function CS({ base, meta }) {
2930
<Header
3031
baseUrl={base}
3132
pageId={match.params.pageId || 'home'}
33+
logoutRedirect={config.URL.COMMUNITIES.COMCAST}
3234
/>
3335
<Switch>
3436
<Route

0 commit comments

Comments
 (0)