diff options
author | Dennis Eriksen <dennis.se@gmail.com> | 2013-05-26 12:28:04 +0200 |
---|---|---|
committer | Dennis Eriksen <dennis.se@gmail.com> | 2013-05-26 12:28:04 +0200 |
commit | 7f0467cc5a5b069ed22f4917b5ada38406839254 (patch) | |
tree | f4cf4920b8b5f44219b81df120f5469996e69f0f /app/models/User.js | |
parent | fixed some text (diff) | |
download | Divid-7f0467cc5a5b069ed22f4917b5ada38406839254.tar.gz |
just cleaning up a bit
Diffstat (limited to '')
-rw-r--r-- | app/models/User.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/User.js b/app/models/User.js index 0dc38f3..668b36f 100644 --- a/app/models/User.js +++ b/app/models/User.js @@ -40,9 +40,7 @@ var UserSchema = new Schema({ * Virtuals */ -UserSchema - .virtual('password') - .set(function(password) { +UserSchema.virtual('password').set(function(password) { this._password = password this.salt = this.makeSalt() this.hashed_password = this.encryptPassword(password) @@ -57,6 +55,7 @@ var validatePrecenceOf = function(value) { return value && value.length; } + // the four validations below only apply if you are signing up traditionally UserSchema.path('name').validate(function(name) { |