mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-27 01:29:17 +01:00
Merge branch 'pr/25'
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user