Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Guest.beforeCreate(function(guest) {
- bcrypt.genSalt(10, function(error, salt) {
- if (error) { return error }
- bcrypt.hash(guest.password, salt, null, function(error, hash) {
- if (error) { return error }
- guest.password = hash;
- })
- })
- });
- Guest.beforeCreate(function(guest) {
- guest.password = "something";
- });
- Guest.beforeCreate(function(guest) {
- bcrypt.genSalt(10, function(error, salt) {
- if (error) { return error }
- bcrypt.hash(guest.password, salt, null, function(error, hash) {
- if (error) { return error }
- guest.password = hash;
- guest.save(); // Added this line to get it to save.
- })
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement