Switch from bcrypt to bcrypt-nodejs to ease install on Windows

This commit is contained in:
Brian Cantoni
2014-01-28 17:51:10 -08:00
parent 7e6273080c
commit bbef4e4b43
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
var mongoose = require('mongoose');
var bcrypt = require('bcrypt');
var bcrypt = require('bcrypt-nodejs');
var userSchema = new mongoose.Schema({
email: { type: String, unique: true },
@ -30,7 +30,7 @@ userSchema.pre('save', function(next) {
bcrypt.genSalt(SALT_FACTOR, function(err, salt) {
if (err) return next(err);
bcrypt.hash(user.password, salt, function(err, hash) {
bcrypt.hash(user.password, salt, null, function(err, hash) {
if (err) return next(err);
user.password = hash;
next();