Skip to content

Commit

Permalink
Merge branch 'pr/25'
Browse files Browse the repository at this point in the history
  • Loading branch information
amoshaviv committed Apr 16, 2014
2 parents c6a8a9b + 8f09b8b commit a976eb9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ UserSchema.methods.hashPassword = function(password) {
* Create instance method for authenticating user
*/
UserSchema.methods.authenticate = function(password) {
if (!this.password || !this.salt) {
return false;
}
return this.password === this.hashPassword(password);
};

Expand Down

0 comments on commit a976eb9

Please sign in to comment.