Removed DB validations
parent
67905dc71e
commit
a89959a2a6
|
@ -22,17 +22,6 @@ var userSchema = new mongoose.Schema({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
userSchema.path('password').validate(function(password) {
|
|
||||||
if (this.provider) return true;
|
|
||||||
return password.length;
|
|
||||||
}, 'Password cannot be blank');
|
|
||||||
|
|
||||||
userSchema.path('username').validate(function(username) {
|
|
||||||
if (this.provider) return true;
|
|
||||||
return username.length;
|
|
||||||
}, 'Email cannot be blank');
|
|
||||||
|
|
||||||
|
|
||||||
userSchema.pre('save', function(next) {
|
userSchema.pre('save', function(next) {
|
||||||
var user = this;
|
var user = this;
|
||||||
var SALT_FACTOR = 5;
|
var SALT_FACTOR = 5;
|
||||||
|
|
Loading…
Reference in New Issue