From 96aec0948829ba3e76fe94621ec2d5e65725827c Mon Sep 17 00:00:00 2001 From: Mikael Korpela Date: Fri, 26 Aug 2016 10:13:51 +0300 Subject: [PATCH] fix(user): specify a digest with crypto.pbkdf2Sync (#1429) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes Node v6 crypto deprecation warning
 “crypto.pbkdf2 without specifying a digest is deprecated. Please specify a digest” --- modules/users/server/models/user.server.model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/users/server/models/user.server.model.js b/modules/users/server/models/user.server.model.js index 5b91ac8639..0797faa404 100644 --- a/modules/users/server/models/user.server.model.js +++ b/modules/users/server/models/user.server.model.js @@ -135,7 +135,7 @@ UserSchema.pre('validate', function (next) { */ UserSchema.methods.hashPassword = function (password) { if (this.salt && password) { - return crypto.pbkdf2Sync(password, new Buffer(this.salt, 'base64'), 10000, 64).toString('base64'); + return crypto.pbkdf2Sync(password, new Buffer(this.salt, 'base64'), 10000, 64, 'SHA1').toString('base64'); } else { return password; }