Skip to content

Commit 03eea4c

Browse files
committed
Upgrading jsDom and JWT decoder.
1 parent d70714f commit 03eea4c

File tree

5 files changed

+132
-114
lines changed

5 files changed

+132
-114
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"global": "^4.4.0",
5959
"highlight.js": "^11.9.0",
6060
"immutable": "^3.8.2",
61-
"jwt-decode": "^3.1.2",
61+
"jwt-decode": "^4.0.0",
6262
"markdown-it": "^13.0.2",
6363
"moment": "^2.30.1",
6464
"pretty-ms": "^8.0.0",
@@ -140,7 +140,7 @@
140140
"git-revision-webpack-plugin": "^5.0.0",
141141
"image-webpack-loader": "^8.1.0",
142142
"isomorphic-style-loader": "^5.3.2",
143-
"jsdom": "^22.1.0",
143+
"jsdom": "^24.1.0",
144144
"json-loader": "^0.5.7",
145145
"less": "^4.2.0",
146146
"less-loader": "^11.1.4",

src/containers/LayoutContainer/LayoutContainer.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,6 @@ class LayoutContainer extends Component {
154154
}
155155
}
156156

157-
LayoutContainer.contextTypes = {
158-
router: PropTypes.object,
159-
};
160-
161157
LayoutContainer.propTypes = {
162158
lang: PropTypes.string,
163159
toggleSize: PropTypes.func.isRequired,

src/redux/helpers/token/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import decodeJwt from 'jwt-decode';
1+
import { jwtDecode } from 'jwt-decode';
22

33
export const decode = token => {
44
try {
5-
return decodeJwt(token);
5+
return jwtDecode(token);
66
} catch (e) {
77
return null;
88
}

test/redux/modules/auth-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import reducerFactory, {
1212
} from '../../../src/redux/modules/auth';
1313
import { isLoggedIn, hasSucceeded, hasFailed, statusSelector } from '../../../src/redux/selectors/auth';
1414

15-
import decodeJwt from 'jwt-decode';
15+
import { jwtDecode } from 'jwt-decode';
1616

1717
chai.use(spies);
1818
const expect = chai.expect;
@@ -106,7 +106,7 @@ describe('Authentication', () => {
106106
const expectedState = fromJS({
107107
status: {},
108108
jwt: validToken,
109-
accessToken: decodeJwt(validToken),
109+
accessToken: jwtDecode(validToken),
110110
userId: 123,
111111
instanceId: 'instance-id',
112112
});

0 commit comments

Comments
 (0)