<commit_before>var mongoose   = require('mongoose');
var bcrypt     = require('bcryptjs');
var crypto     = require('crypto');
var Schema     = mongoose.Schema;
var Role       = require('./role.js');

var UserSchema = Schema({
    username: { type: String, index: true },
    password: { type: String },
    fname: { type: String },
    lname: { type: String },
    email:    { type: String },
    phonenumber: { type: Number },
    names: { type: String },
    role:     [{type: Schema.Types.ObjectId, ref:Role }]
});


module.exports.createUser = function(newUser,callback){
  bcrypt.genSalt(10,function(err,salt){
    if(err) throw err;
    bcrypt.hash(newUser.local.password,salt,function(err,hash){<commit_msg>remove unrequired fields such as phone number from user model<commit_after>var mongoose   = require('mongoose');
var bcrypt     = require('bcryptjs');
var crypto     = require('crypto');
var Schema     = mongoose.Schema;
var Role       = require('./role.js');

var UserSchema = Schema({
    username: { type: String, index: true },
    password: { type: String },
    fname: { type: String },
    lname: { type: String },
    email:    { type: String },
    role:     [{type: Schema.Types.ObjectId, ref:Role }]
});


module.exports.createUser = function(newUser,callback){
  bcrypt.genSalt(10,function(err,salt){
    if(err) throw err;
    bcrypt.hash(newUser.local.password,salt,function(err,hash){
{'fraction_non_alphanumeric': 0.15275813295615276, 'fraction_numerical': 0.002828854314002829, 'mean_word_length': 3.594155844155844, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '176671', 'n_tokens_mistral': 451, 'n_tokens_neox': 446, 'n_words': 106}