email validations work, now on to username validations

This commit is contained in:
Michael Q Larson
2014-12-23 18:20:53 -08:00
parent 20475ffcc4
commit fcd457b958
8 changed files with 170 additions and 85 deletions

View File

@ -3,15 +3,13 @@ var crypto = require('crypto');
var mongoose = require('mongoose');
var userSchema = new mongoose.Schema({
/*email: {
email: {
type: String,
unique: true,
lowercase: true,
match: /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/
},*/
email: String,
trim: true
},
password: String,
facebook: String,
twitter: String,
google: String,
@ -283,13 +281,14 @@ var userSchema = new mongoose.Schema({
picture: {
type: String,
default: ''
}
/*username: {
},
username: {
type: String,
default: '',
unique: true,
match: /^[a-zA-Z0-9_]+$/
}*/
lowercase: true,
trim: true
}
},
resetPasswordToken: String,