Skip to content

Commit c269dcd

Browse files
committed
Fix Node.js deprecation warnings
1 parent de9c34e commit c269dcd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

authorization/controllers/authorization.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ exports.login = (req, res) => {
1010
let hash = crypto.createHmac('sha512', salt).update(refreshId).digest("base64");
1111
req.body.refreshKey = salt;
1212
let token = jwt.sign(req.body, jwtSecret);
13-
let b = new Buffer(hash);
13+
let b = Buffer.from(hash);
1414
let refresh_token = b.toString('base64');
1515
res.status(201).send({accessToken: token, refreshToken: refresh_token});
1616
} catch (err) {

common/middlewares/auth.validation.middleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exports.verifyRefreshBodyField = (req, res, next) => {
1111
};
1212

1313
exports.validRefreshNeeded = (req, res, next) => {
14-
let b = new Buffer(req.body.refresh_token, 'base64');
14+
let b = Buffer.from(req.body.refresh_token, 'base64');
1515
let refresh_token = b.toString();
1616
let hash = crypto.createHmac('sha512', req.jwt.refreshKey).update(req.jwt.userId + secret).digest("base64");
1717
if (hash === refresh_token) {

0 commit comments

Comments
 (0)