Merge branch 'bcantoni-master'
* bcantoni-master: Switch from bcrypt to bcrypt-nodejs to ease install on Windows
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
var mongoose = require('mongoose');
|
var mongoose = require('mongoose');
|
||||||
var bcrypt = require('bcrypt');
|
var bcrypt = require('bcrypt-nodejs');
|
||||||
|
|
||||||
var userSchema = new mongoose.Schema({
|
var userSchema = new mongoose.Schema({
|
||||||
email: { type: String, unique: true },
|
email: { type: String, unique: true },
|
||||||
@ -30,7 +30,7 @@ userSchema.pre('save', function(next) {
|
|||||||
bcrypt.genSalt(SALT_FACTOR, function(err, salt) {
|
bcrypt.genSalt(SALT_FACTOR, function(err, salt) {
|
||||||
if (err) return next(err);
|
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);
|
if (err) return next(err);
|
||||||
user.password = hash;
|
user.password = hash;
|
||||||
next();
|
next();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"async": "~0.2.10",
|
"async": "~0.2.10",
|
||||||
"bcrypt": "~0.7.7",
|
"bcrypt-nodejs": "~0.0.3",
|
||||||
"cheerio": "~0.13.1",
|
"cheerio": "~0.13.1",
|
||||||
"express": "~3.4.8",
|
"express": "~3.4.8",
|
||||||
"express-flash": "~0.0.2",
|
"express-flash": "~0.0.2",
|
||||||
|
Reference in New Issue
Block a user