Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Hash the user's password before inserting a new user
- // userSchema.pre('save', function (next) {
- // let user = this;
- // if (this.isModified('password') || this.isNew) {
- // bcrypt.genSalt(10, function (err, salt) {
- // if (err) {
- // return next(err);
- // }
- // bcrypt.hash(user.password, salt, null, function (err, hash) {
- // if (err) {
- // return next(err);
- // }
- // user.password = hash;
- // next();
- // });
- // });
- // } else {
- // return next();
- // }
- // });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement