Advertisement
utrolig

Untitled

Jun 3rd, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. hashPass.new(user.password, function(result){
  2.         user.password = result;
  3.         db('users').insert(user)
  4.             .then(function (resolve){
  5.                 res.json({success: true, msg: 'Successful created new user.'});
  6.             }, function(err, reject){
  7.                 res.json({success: false, msg: 'Error:' + err});
  8.         })
  9.     })
  10.  
  11.  
  12. hashPass = {
  13.     new: function(password, callback){
  14.         var hashed;
  15.         bcrypt.hash(password, 10, function(err, hash){
  16.             var hashed = hash;
  17.             callback(hashed);
  18.         });
  19.     }
  20. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement