Skip to content

Commit 013f693

Browse files
Merge pull request #278 from topcoder-platform/develop
Release 2020-10-29 - Auth0 RS256
2 parents 6e354ea + 8f9a0f8 commit 013f693

File tree

12 files changed

+16
-16
lines changed

12 files changed

+16
-16
lines changed

__tests__/reducers/auth.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const mockActions = {
2020
jest.setMock(require.resolve('actions/auth'), mockActions);
2121
jest.setMock(require.resolve('actions/profile'), mockActions);
2222

23-
jest.setMock('tc-accounts', {
23+
jest.setMock('@topcoder-platform/tc-auth-lib', {
2424
decodeToken: () => 'User object',
2525
isTokenExpired: () => false,
2626
});

__tests__/reducers/challenge.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const mockSmpActions = {
4444
};
4545
_.merge(actions, mockSmpActions);
4646

47-
jest.setMock('tc-accounts', {
47+
jest.setMock('@topcoder-platform/tc-auth-lib', {
4848
decodeToken: () => 'User object',
4949
isTokenExpired: () => false,
5050
});

config/jest/setup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* global jest */
22
require('topcoder-react-utils/config/jest/setup');
33

4-
jest.setMock('tc-accounts', {
4+
jest.setMock('@topcoder-platform/tc-auth-lib', {
55
decodeToken: token => (token ? {
66
handle: 'username12345',
77
userId: '12345',

config/webpack/default.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = {
2222
'redux',
2323
'redux-actions',
2424
'isomorphic-fetch',
25-
'tc-accounts',
25+
'@topcoder-platform/tc-auth-lib',
2626
'to-capital-case',
2727
'topcoder-react-utils',
2828
'tc-core-library-js',

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
3232
"test": "npm run lint && npm run jest"
3333
},
34-
"version": "1.0.8",
34+
"version": "1.1.0",
3535
"dependencies": {
3636
"auth0-js": "^6.8.4",
3737
"config": "^3.2.0",
@@ -47,10 +47,10 @@
4747
"react-redux": "^6.0.1",
4848
"redux": "^3.7.2",
4949
"redux-actions": "^2.4.0",
50-
"tc-accounts": "https://github.com/appirio-tech/accounts-app.git#dev",
5150
"tc-core-library-js": "appirio-tech/tc-core-library-js.git#v2.6",
5251
"to-capital-case": "^1.0.0",
53-
"topcoder-react-utils": "0.7.5"
52+
"topcoder-react-utils": "0.7.5",
53+
"@topcoder-platform/tc-auth-lib": "git+https://github.com/topcoder-platform/tc-auth-lib.git#1.0.1"
5454
},
5555
"devDependencies": {
5656
"autoprefixer": "^8.6.4",

src/actions/auth.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { createActions } from 'redux-actions';
7-
import { decodeToken } from 'tc-accounts';
7+
import { decodeToken } from '@topcoder-platform/tc-auth-lib';
88
import { getApiV3, getApiV5 } from '../services/api';
99

1010
/**

src/actions/challenge.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import _ from 'lodash';
88
import { config } from 'topcoder-react-utils';
99
import { createActions } from 'redux-actions';
10-
import { decodeToken } from 'tc-accounts';
10+
import { decodeToken } from '@topcoder-platform/tc-auth-lib';
1111
import { getService as getChallengesService } from '../services/challenges';
1212
import { getService as getSubmissionService } from '../services/submissions';
1313
import { getApi } from '../services/api';
@@ -248,7 +248,7 @@ function loadResultsInit(challengeId) {
248248
* @return {Action}
249249
*/
250250
function loadResultsDone(auth, challengeId, type) {
251-
return getApi('V2', auth.tokenV2)
251+
return getApi('V2')
252252
.fetch(`/${type}/challenges/result/${challengeId}`)
253253
.then(response => response.json())
254254
.then(response => ({
@@ -273,7 +273,7 @@ function fetchCheckpointsInit() {}
273273
*/
274274
function fetchCheckpointsDone(tokenV2, challengeId) {
275275
const endpoint = `/design/challenges/checkpoint/${challengeId}`;
276-
return getApi('V2', tokenV2).fetch(endpoint)
276+
return getApi('V2').fetch(endpoint)
277277
.then((response) => {
278278
if (response.status !== 200) {
279279
throw response.status;

src/reducers/auth.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414

1515
import _ from 'lodash';
16-
import { decodeToken } from 'tc-accounts';
16+
import { decodeToken } from '@topcoder-platform/tc-auth-lib';
1717
import { redux } from 'topcoder-react-utils';
1818
import actions from '../actions/auth';
1919
import profileActions from '../actions/profile';

src/reducers/challenge.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function onFetchCheckpointsDone(state, action) {
173173
loadingCheckpoints: false,
174174
};
175175
}
176-
if (state.details && state.details.legacyId === action.payload.challengeId) {
176+
if (state.details && `${state.details.legacyId}` === `${action.payload.challengeId}`) {
177177
return {
178178
...state,
179179
checkpoints: action.payload.checkpoints,

src/reducers/direct.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import _ from 'lodash';
88
import { handleActions } from 'redux-actions';
9-
import { decodeToken } from 'tc-accounts';
9+
import { decodeToken } from '@topcoder-platform/tc-auth-lib';
1010
import actions from '../actions/direct';
1111
import logger from '../utils/logger';
1212
import { fireErrorMessage } from '../utils/errors';

src/services/challenges.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import _ from 'lodash';
88
import moment from 'moment';
99
import qs from 'qs';
10-
import { decodeToken } from 'tc-accounts';
10+
import { decodeToken } from '@topcoder-platform/tc-auth-lib';
1111
import logger from '../utils/logger';
1212
import { setErrorIcon, ERROR_ICON_TYPES } from '../utils/errors';
1313
import { COMPETITION_TRACKS, getApiResponsePayload } from '../utils/tc';

src/services/members.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/* global XMLHttpRequest */
88
import _ from 'lodash';
99
import qs from 'qs';
10-
import { decodeToken } from 'tc-accounts';
10+
import { decodeToken } from '@topcoder-platform/tc-auth-lib';
1111
import logger from '../utils/logger';
1212
import { getApiResponsePayload } from '../utils/tc';
1313
import { getApi } from './api';

0 commit comments

Comments
 (0)