Skip to content

Commit 2956fd3

Browse files
committed
updated to express-jwt 6.0.0 to fix security vulnerability
1 parent 449e79b commit 2956fd3

File tree

3 files changed

+52
-52
lines changed

3 files changed

+52
-52
lines changed

_middleware/authorize.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const expressJwt = require('express-jwt');
1+
const jwt = require('express-jwt');
22
const { secret } = require('config.json');
33
const db = require('_helpers/db');
44

@@ -13,7 +13,7 @@ function authorize(roles = []) {
1313

1414
return [
1515
// authenticate JWT token and attach user to request object (req.user)
16-
expressJwt({ secret }),
16+
jwt({ secret, algorithms: ['HS256'] }),
1717

1818
// authorize based on user role
1919
async (req, res, next) => {

package-lock.json

Lines changed: 49 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"cookie-parser": "^1.4.5",
1919
"cors": "^2.8.5",
2020
"express": "^4.17.1",
21-
"express-jwt": "^5.3.3",
21+
"express-jwt": "^6.0.0",
2222
"jsonwebtoken": "^8.5.1",
2323
"mongodb": "^3.5.7",
2424
"mongoose": "^5.9.11",

0 commit comments

Comments
 (0)