Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports.addUser = function(newUser, callback){
- bcrypt.genSalt(10, (err, salt)=>{
- if(err)
- {
- console.log("failed before hash");
- }
- bcrypt.hash(newUser.password, salt, (err, hash)=>{
- if(err){
- console.log("Failed after hash");
- throw err;
- }
- newUser.password = hash;
- newUser.save(callback);
- });
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement