Added google token, modified admin attribute, email is now username and old email is just plain email, no longer a primary key, first name and last name are just name now

This commit is contained in:
Sahat Yalkabov
2013-12-05 22:42:20 -05:00
parent 3e41002cf2
commit 0c842286ef

View File

@ -2,12 +2,12 @@ var mongoose = require('mongoose'),
bcrypt = require('bcrypt'); bcrypt = require('bcrypt');
var userSchema = new mongoose.Schema({ var userSchema = new mongoose.Schema({
email: { type: String, unique: true }, username: { type: String, unique: true },
admin: { type: Boolean, default: false }, email: String,
firstName: String, name: String,
lastName: String,
password: String, password: String,
tokens: { tokens: {
google: String,
facebook: String, facebook: String,
foursquare: String, foursquare: String,
twitter: String, twitter: String,
@ -15,7 +15,8 @@ var userSchema = new mongoose.Schema({
}, },
provider: String, provider: String,
facebook: String, facebook: String,
google: String google: String,
isAdmin: Boolean,
}); });
userSchema.path('password').validate(function(password) { userSchema.path('password').validate(function(password) {