Advertisement
Guest User

Untitled

a guest
Jul 5th, 2018
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. // Hash the user's password before inserting a new user
  2. // userSchema.pre('save', function (next) {
  3. // let user = this;
  4. // if (this.isModified('password') || this.isNew) {
  5. // bcrypt.genSalt(10, function (err, salt) {
  6. // if (err) {
  7. // return next(err);
  8. // }
  9. // bcrypt.hash(user.password, salt, null, function (err, hash) {
  10. // if (err) {
  11. // return next(err);
  12. // }
  13. // user.password = hash;
  14. // next();
  15. // });
  16. // });
  17. // } else {
  18. // return next();
  19. // }
  20. // });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement