Skip to content

Release 2020-10-29 - Auth0 RS256 #278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Oct 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/reducers/auth.js
Original file line number Diff line number Diff line change
@@ -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,
});
2 changes: 1 addition & 1 deletion __tests__/reducers/challenge.js
Original file line number Diff line number Diff line change
@@ -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,
});
2 changes: 1 addition & 1 deletion config/jest/setup.js
Original file line number Diff line number Diff line change
@@ -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',
2 changes: 1 addition & 1 deletion config/webpack/default.js
Original file line number Diff line number Diff line change
@@ -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',
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
"test": "npm run lint && npm run jest"
},
"version": "1.0.8",
"version": "1.1.0",
"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",
2 changes: 1 addition & 1 deletion src/actions/auth.js
Original file line number Diff line number Diff line change
@@ -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';

/**
6 changes: 3 additions & 3 deletions src/actions/challenge.js
Original file line number Diff line number Diff line change
@@ -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';
@@ -248,7 +248,7 @@ function loadResultsInit(challengeId) {
* @return {Action}
*/
function loadResultsDone(auth, challengeId, type) {
return getApi('V2', auth.tokenV2)
return getApi('V2')
.fetch(`/${type}/challenges/result/${challengeId}`)
.then(response => response.json())
.then(response => ({
@@ -273,7 +273,7 @@ function fetchCheckpointsInit() {}
*/
function fetchCheckpointsDone(tokenV2, challengeId) {
const endpoint = `/design/challenges/checkpoint/${challengeId}`;
return getApi('V2', tokenV2).fetch(endpoint)
return getApi('V2').fetch(endpoint)
.then((response) => {
if (response.status !== 200) {
throw response.status;
2 changes: 1 addition & 1 deletion src/reducers/auth.js
Original file line number Diff line number Diff line change
@@ -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';
2 changes: 1 addition & 1 deletion src/reducers/challenge.js
Original file line number Diff line number Diff line change
@@ -173,7 +173,7 @@ function onFetchCheckpointsDone(state, action) {
loadingCheckpoints: false,
};
}
if (state.details && state.details.legacyId === action.payload.challengeId) {
if (state.details && `${state.details.legacyId}` === `${action.payload.challengeId}`) {
return {
...state,
checkpoints: action.payload.checkpoints,
2 changes: 1 addition & 1 deletion src/reducers/direct.js
Original file line number Diff line number Diff line change
@@ -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';
2 changes: 1 addition & 1 deletion src/services/challenges.js
Original file line number Diff line number Diff line change
@@ -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';
2 changes: 1 addition & 1 deletion src/services/members.js
Original file line number Diff line number Diff line change
@@ -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';