Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
fix(user): specify a digest with crypto.pbkdf2Sync (#1429)
Browse files Browse the repository at this point in the history
Fixes Node v6 crypto deprecation warning
 “crypto.pbkdf2 without specifying a digest is deprecated. Please specify a digest”
  • Loading branch information
simison authored and lirantal committed Aug 26, 2016
1 parent 234f0c6 commit 96aec09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/users/server/models/user.server.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 96aec09

Please sign in to comment.