diff --git a/__tests__/reducers/auth.js b/__tests__/reducers/auth.js index 6861d5b4..6abeecb0 100644 --- a/__tests__/reducers/auth.js +++ b/__tests__/reducers/auth.js @@ -20,7 +20,7 @@ const mockActions = { jest.setMock(require.resolve('actions/auth'), mockActions); jest.setMock(require.resolve('actions/profile'), mockActions); -jest.setMock('tc-accounts', { +jest.setMock('@topcoder-platform/tc-auth-lib', { decodeToken: () => 'User object', isTokenExpired: () => false, }); diff --git a/__tests__/reducers/challenge.js b/__tests__/reducers/challenge.js index b35324c1..1e698a95 100644 --- a/__tests__/reducers/challenge.js +++ b/__tests__/reducers/challenge.js @@ -44,7 +44,7 @@ const mockSmpActions = { }; _.merge(actions, mockSmpActions); -jest.setMock('tc-accounts', { +jest.setMock('@topcoder-platform/tc-auth-lib', { decodeToken: () => 'User object', isTokenExpired: () => false, }); diff --git a/config/jest/setup.js b/config/jest/setup.js index fc594f0f..de4e7b17 100644 --- a/config/jest/setup.js +++ b/config/jest/setup.js @@ -1,7 +1,7 @@ /* global jest */ require('topcoder-react-utils/config/jest/setup'); -jest.setMock('tc-accounts', { +jest.setMock('@topcoder-platform/tc-auth-lib', { decodeToken: token => (token ? { handle: 'username12345', userId: '12345', diff --git a/config/webpack/default.js b/config/webpack/default.js index 4872dd72..7389aac2 100644 --- a/config/webpack/default.js +++ b/config/webpack/default.js @@ -22,7 +22,7 @@ module.exports = { 'redux', 'redux-actions', 'isomorphic-fetch', - 'tc-accounts', + '@topcoder-platform/tc-auth-lib', 'to-capital-case', 'topcoder-react-utils', 'tc-core-library-js', diff --git a/package.json b/package.json index a19edae2..f71524eb 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .", "test": "npm run lint && npm run jest" }, - "version": "1000.24.6", + "version": "1000.23.2", "dependencies": { "auth0-js": "^6.8.4", "config": "^3.2.0", @@ -47,10 +47,10 @@ "react-redux": "^6.0.1", "redux": "^3.7.2", "redux-actions": "^2.4.0", - "tc-accounts": "https://github.com/appirio-tech/accounts-app.git#dev", "tc-core-library-js": "appirio-tech/tc-core-library-js.git#v2.6", "to-capital-case": "^1.0.0", - "topcoder-react-utils": "0.7.5" + "topcoder-react-utils": "0.7.5", + "@topcoder-platform/tc-auth-lib": "git+https://github.com/topcoder-platform/tc-auth-lib.git#1.0.1" }, "devDependencies": { "autoprefixer": "^8.6.4", diff --git a/src/actions/auth.js b/src/actions/auth.js index f758d9ed..f81b62f9 100644 --- a/src/actions/auth.js +++ b/src/actions/auth.js @@ -4,7 +4,7 @@ */ import { createActions } from 'redux-actions'; -import { decodeToken } from 'tc-accounts'; +import { decodeToken } from '@topcoder-platform/tc-auth-lib'; import { getApiV3, getApiV5 } from '../services/api'; /** diff --git a/src/actions/challenge.js b/src/actions/challenge.js index f600bdc9..a2d538ab 100644 --- a/src/actions/challenge.js +++ b/src/actions/challenge.js @@ -7,7 +7,7 @@ import _ from 'lodash'; import { config } from 'topcoder-react-utils'; import { createActions } from 'redux-actions'; -import { decodeToken } from 'tc-accounts'; +import { decodeToken } from '@topcoder-platform/tc-auth-lib'; import { getService as getChallengesService } from '../services/challenges'; import { getService as getSubmissionService } from '../services/submissions'; import { getApi } from '../services/api'; diff --git a/src/reducers/auth.js b/src/reducers/auth.js index 9a5adee5..d16f93f0 100644 --- a/src/reducers/auth.js +++ b/src/reducers/auth.js @@ -13,7 +13,7 @@ */ import _ from 'lodash'; -import { decodeToken } from 'tc-accounts'; +import { decodeToken } from '@topcoder-platform/tc-auth-lib'; import { redux } from 'topcoder-react-utils'; import actions from '../actions/auth'; import profileActions from '../actions/profile'; diff --git a/src/reducers/direct.js b/src/reducers/direct.js index f0122611..a86e73ac 100644 --- a/src/reducers/direct.js +++ b/src/reducers/direct.js @@ -6,7 +6,7 @@ import _ from 'lodash'; import { handleActions } from 'redux-actions'; -import { decodeToken } from 'tc-accounts'; +import { decodeToken } from '@topcoder-platform/tc-auth-lib'; import actions from '../actions/direct'; import logger from '../utils/logger'; import { fireErrorMessage } from '../utils/errors'; diff --git a/src/services/challenges.js b/src/services/challenges.js index e232274b..46aa2a4e 100644 --- a/src/services/challenges.js +++ b/src/services/challenges.js @@ -7,7 +7,7 @@ import _ from 'lodash'; import moment from 'moment'; import qs from 'qs'; -import { decodeToken } from 'tc-accounts'; +import { decodeToken } from '@topcoder-platform/tc-auth-lib'; import logger from '../utils/logger'; import { setErrorIcon, ERROR_ICON_TYPES } from '../utils/errors'; import { COMPETITION_TRACKS, getApiResponsePayload } from '../utils/tc'; diff --git a/src/services/members.js b/src/services/members.js index a5b32a51..d1cd5b09 100644 --- a/src/services/members.js +++ b/src/services/members.js @@ -7,7 +7,7 @@ /* global XMLHttpRequest */ import _ from 'lodash'; import qs from 'qs'; -import { decodeToken } from 'tc-accounts'; +import { decodeToken } from '@topcoder-platform/tc-auth-lib'; import logger from '../utils/logger'; import { getApiResponsePayload } from '../utils/tc'; import { getApi } from './api';