Updated user schema (provider field was not used)
parent
e820b9f02a
commit
c0e1a1129a
|
@ -5,12 +5,11 @@ var userSchema = new mongoose.Schema({
|
|||
email: { type: String, unique: true },
|
||||
password: String,
|
||||
|
||||
tokens: Array,
|
||||
provider: String,
|
||||
facebook: { type: String, unique: true, sparse: true },
|
||||
twitter: { type: String, unique: true, sparse: true },
|
||||
google: { type: String, unique: true, sparse: true },
|
||||
github: { type: String, unique: true, sparse: true },
|
||||
tokens: Array,
|
||||
|
||||
profile: {
|
||||
name: { type: String, default: '' },
|
||||
|
@ -21,6 +20,10 @@ var userSchema = new mongoose.Schema({
|
|||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Hash the password for security.
|
||||
*/
|
||||
|
||||
userSchema.pre('save', function(next) {
|
||||
var user = this;
|
||||
var SALT_FACTOR = 5;
|
||||
|
|
Loading…
Reference in New Issue