Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- userSchema.pre('save', function (next) {
- var user = this;
- bcrypt.hash(user.password, null, null, function (err, hash) {
- if (err) return next();
- user.password = hash;
- next();
- })
- //next();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement