How to use the genSaltSync function from bcrypt-nodejs

Find comprehensive JavaScript bcrypt-nodejs.genSaltSync code examples handpicked from public code repositorys.

43
44
45
46
47
48
49
50
51
52

initialize: function() {
  this.on('saving', function(model,attrs,options){
    if (model.get('authType') === 'local'){
      var password = model.get('password');
      var salt = bcrypt.genSaltSync();
      var hash = bcrypt.hashSync(password);
      model.set('password',hash);
    }
  });
fork icon0
star icon10
watch icon2