Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hashPass.new(user.password, function(result){
- user.password = result;
- db('users').insert(user)
- .then(function (resolve){
- res.json({success: true, msg: 'Successful created new user.'});
- }, function(err, reject){
- res.json({success: false, msg: 'Error:' + err});
- })
- })
- hashPass = {
- new: function(password, callback){
- var hashed;
- bcrypt.hash(password, 10, function(err, hash){
- var hashed = hash;
- callback(hashed);
- });
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement