function cryptPassword(password, callback) {
bcrypt.genSalt(SALT_WORK_FACTOR, function(err, salt) {
if (err)
return callback(err);
bcrypt.hash(password, salt, null, function(err, hash) {
return callback(err, hash);
});
});
}
User.beforeCreate((user, options, ...