Advertisement
Guest User

Untitled

a guest
Sep 14th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. userSchema.pre('save', function (next) {
  2.  
  3. var user = this;
  4.  
  5. bcrypt.hash(user.password, null, null, function (err, hash) {
  6. if (err) return next();
  7. user.password = hash;
  8. next();
  9. })
  10.  
  11. //next();
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement