text: var mongoose = require('mongoose');
  var bcrypt = require('bcrypt-nodejs');
  
  // define the schema for our user model
  var userSchema = mongoose.Schema({
  
      local            : {
          email        : String,
          password     : String,
      }
  });
  
  
  //Generate Hash
  userSchema.methods.generateHash = function(password) {
      return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null);
  };
  
  //Check if Password valid
  userSchema.methods.validPassword = function(password) {
      return bcrypt.compareSync(password, this.local.password);
  };
  
  //create the model for users and expose it back to app
  module.exports = mongoose.model('User', userSchema);