Skip to content

Commit 5e55b9f

Browse files
author
sachin-maheshwari
authored
Merge pull request #4174 from appirio-tech/hotfix/new-auth
Master (Hotfix): new auth changes - 29 Oct 2020
2 parents 7332a96 + 0a357cc commit 5e55b9f

File tree

11 files changed

+21
-20
lines changed

11 files changed

+21
-20
lines changed

.circleci/config.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
version: 2
22
defaults: &defaults
33
docker:
4-
- image: circleci/node:8.9.4-browsers
4+
- image: node:14
55
deploy_defaults: &deploy_defaults
66
docker:
77
- image: cibuilds/aws
88
install_dependency: &install_dependency
99
name: Installation of build and deployment dependencies.
1010
command: |
11-
sudo apt install python-dev python-pip -y
12-
sudo pip install awscli --upgrade
11+
apt update
12+
apt install jq -y
13+
apt install python-dev python-pip -y
14+
pip install awscli --upgrade
1315
install_deploysuite: &install_deploysuite
1416
name: Installation of install_deploysuite.
1517
command: |

config/constants/dev.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ module.exports = {
3030
TCO17_URL : 'https://tco17.topcoder-dev.com',
3131
TCO_HOME_URL : 'https://www.topcoder-dev.com/tco',
3232

33-
ACCOUNTS_APP_URL : 'https://accounts.topcoder-dev.com/#!/member',
34-
ACCOUNTS_APP_CONNECTOR_URL : 'https://accounts.topcoder-dev.com/connector.html',
33+
ACCOUNTS_APP_URL : 'https://accounts-auth0.topcoder-dev.com',
34+
ACCOUNTS_APP_CONNECTOR_URL : 'https://accounts-auth0.topcoder-dev.com',
3535

3636
FILE_PICKER_API_KEY: process.env.FILE_PICKER_API_KEY_DEV,
3737
FILE_PICKER_SUBMISSION_CONTAINER_NAME: 'submission-staging-dev',

config/constants/master.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ module.exports = {
3131
TCO17_URL : 'https://tco17.topcoder.com',
3232
TCO_HOME_URL : 'https://www.topcoder.com/tco',
3333

34-
ACCOUNTS_APP_URL : 'https://accounts.topcoder.com/#!/member',
35-
ACCOUNTS_APP_CONNECTOR_URL : 'https://accounts.topcoder.com/connector.html',
34+
ACCOUNTS_APP_URL : 'https://accounts-auth0.topcoder.com',
35+
ACCOUNTS_APP_CONNECTOR_URL : 'https://accounts-auth0.topcoder.com',
3636

3737
FILE_PICKER_API_KEY: process.env.FILE_PICKER_API_KEY_PROD,
3838
FILE_PICKER_SUBMISSION_CONTAINER_NAME: 'submission-staging-prod',

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"remarkable": "^1.7.4",
151151
"sanitize-html": "^1.27.4",
152152
"svg-react-loader": "^0.4.5",
153-
"tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#v1.0.4",
153+
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.1",
154154
"tc-ui": "git+https://github.com/appirio-tech/tc-ui.git#feature/connectv2",
155155
"tlds": "^1.191.0",
156156
"topcoder-react-utils": "0.0.39",

src/actions/loadUser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
ROLE_PROGRAM_MANAGER,
1616
ROLE_PRESALES, ROLE_PROJECT_MANAGER, ROLE_SOLUTION_ARCHITECT
1717
} from '../config/constants'
18-
import { getFreshToken, configureConnector, decodeToken } from 'tc-accounts'
18+
import { getFreshToken, configureConnector, decodeToken } from 'tc-auth-lib'
1919
import { getUserProfile } from '../api/users'
2020
import { getUserGroups } from '../api/groups'
2121
import { getOrgConfig } from '../api/orgConfig'

src/api/requestInterceptor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import axios from 'axios'
22
import store from '../config/store'
3-
import { getFreshToken, isTokenExpired } from 'tc-accounts'
3+
import { getFreshToken, isTokenExpired } from 'tc-auth-lib'
44

55
export const getToken = () => {
66
return new Promise((resolve, reject) => {

src/components/AuthenticatedComponent.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { withRouter } from 'react-router-dom'
3-
import { getFreshToken } from 'tc-accounts'
3+
import { getFreshToken } from 'tc-auth-lib'
44
import { ACCOUNTS_APP_LOGIN_URL } from '../config/constants'
55

66
export function requiresAuthentication(Component) {

src/components/Home/Home.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { connect } from 'react-redux'
33
import { withRouter } from 'react-router-dom'
44
import './Home.scss'
55
import homeImgSrc from '../../assets/images/hero-tc-landing.png'
6-
import { DOMAIN, ACCOUNTS_APP_REGISTER_URL } from '../../config/constants'
6+
import { DOMAIN, ACCOUNTS_APP_LOGIN_URL } from '../../config/constants'
77

88
class Home extends React.Component {
99
constructor(props) {
@@ -18,7 +18,7 @@ class Home extends React.Component {
1818
}
1919

2020
render() {
21-
const registerUrl = ACCOUNTS_APP_REGISTER_URL
21+
const registerUrl = `${ACCOUNTS_APP_LOGIN_URL}?regSource=tcBusiness&retUrl=${window.location.protocol}//${window.location.host}/`
2222
const learnMoreUrl = 'https://www.' + DOMAIN +'/about-topcoder/connect/'
2323
return (
2424
<div className="content content-home">

src/components/TopBar/TopBarContainer.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import _ from 'lodash'
55
import UserDropdown from 'appirio-tech-react-components/components/UserDropdownMenu/UserDropdownMenu'
66
import {
77
ACCOUNTS_APP_LOGIN_URL,
8-
ACCOUNTS_APP_REGISTER_URL,
98
ROLE_CONNECT_COPILOT,
109
ROLE_CONNECT_MANAGER,
1110
ROLE_ADMINISTRATOR,
@@ -72,10 +71,10 @@ class TopBarContainer extends React.Component {
7271
const userImage = getAvatarResized(bigPhotoURL, 80)
7372
const userName = getFullNameWithFallback(user)
7473
const homePageUrl = `${window.location.protocol}//${window.location.host}/`
75-
const logoutLink = `https://accounts.${DOMAIN}/#!/logout?retUrl=${homePageUrl}`
74+
const logoutLink = `${ACCOUNTS_APP_LOGIN_URL}?logout=true&retUrl=${homePageUrl}`
7675
const isHomePage = this.props.match.path === '/'
77-
const loginUrl = `${ACCOUNTS_APP_LOGIN_URL}?retUrl=${window.location.protocol}//${window.location.host}/`
78-
const registerUrl = !isHomePage ? ACCOUNTS_APP_REGISTER_URL : null
76+
const loginUrl = `${ACCOUNTS_APP_LOGIN_URL}?regSource=tcBusiness&retUrl=${window.location.protocol}//${window.location.host}/`
77+
const registerUrl = !isHomePage ? loginUrl : null
7978
const isLoggedIn = !!(userRoles && userRoles.length)
8079

8180
const logoutClick = (evt) => {

src/config/constants.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,8 @@ export const DOMAIN = process.env.domain || 'topcoder.com'
724724
export const CONNECT_DOMAIN = `connect.${DOMAIN}`
725725
export const CONNECT_MAIN_PAGE_URL = `http://connect.${DOMAIN}`
726726
export const ACCOUNTS_APP_CONNECTOR_URL = process.env.ACCOUNTS_APP_CONNECTOR_URL
727-
export const ACCOUNTS_APP_LOGIN_URL = process.env.ACCOUNTS_APP_LOGIN_URL || `https://accounts.${DOMAIN}/#!/member`
728-
export const ACCOUNTS_APP_REGISTER_URL = process.env.ACCOUNTS_APP_REGISTER_URL || `https://accounts.${DOMAIN}/#!/member/registration?regSource=tcBusiness`
727+
export const ACCOUNTS_APP_LOGIN_URL = process.env.ACCOUNTS_APP_LOGIN_URL || `https://accounts-auth0.${DOMAIN}`
728+
export const ACCOUNTS_APP_REGISTER_URL = process.env.ACCOUNTS_APP_REGISTER_URL || `https://accounts-auth0.${DOMAIN}`
729729

730730
export const TC_API_URL = `https://api.${DOMAIN}`
731731
export const DIRECT_PROJECT_URL = `https://www.${DOMAIN}/direct/projectOverview?formData.projectId=`

src/routes.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import LoadingIndicator from './components/LoadingIndicator/LoadingIndicator'
1919
import OrganizationPage from './components/SpecialPage/OrganizationPage'
2020
import {ACCOUNTS_APP_LOGIN_URL, PROJECT_FEED_TYPE_PRIMARY, PROJECT_FEED_TYPE_MESSAGES } from './config/constants'
2121
import { getTopic } from './api/messages'
22-
import { getFreshToken } from 'tc-accounts'
22+
import { getFreshToken } from 'tc-auth-lib'
2323
import { scrollToHash } from './components/ScrollToAnchors.jsx'
2424

2525
import { TCEmitter } from './helpers'

0 commit comments

Comments
 (0)