From a89959a2a6e733e6f2908608b289701f7b16c61f Mon Sep 17 00:00:00 2001 From: Sahat Yalkabov Date: Wed, 1 Jan 2014 02:35:37 -0500 Subject: [PATCH] Removed DB validations --- models/User.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/models/User.js b/models/User.js index 3f68208f5e..398f1d40bf 100644 --- a/models/User.js +++ b/models/User.js @@ -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) { var user = this; var SALT_FACTOR = 5;