Remove message prefix as debug will print it

This commit is contained in:
Raymond Feng 2014-01-27 14:47:48 -08:00
parent c35f762d4e
commit 938cafeb77
1 changed files with 4 additions and 4 deletions

View File

@ -144,24 +144,24 @@ User.login = function (credentials, fn) {
var defaultError = new Error('login failed');
if(err) {
debug('User: error reported from User.findOne: %j', err);
debug('An error is reported from User.findOne: %j', err);
fn(defaultError);
} else if(user) {
user.hasPassword(credentials.password, function(err, isMatch) {
if(err) {
debug('User: error reported from User.hasPassword: %j', err);
debug('An error is reported from User.hasPassword: %j', err);
fn(defaultError);
} else if(isMatch) {
user.accessTokens.create({
ttl: Math.min(credentials.ttl || User.settings.ttl, User.settings.maxTTL)
}, fn);
} else {
debug('User: invalid password for user %s', query.email || query.username);
debug('The password is invalid for user %s', query.email || query.username);
fn(defaultError);
}
});
} else {
debug('User: no matching record found for user %s', query.email || query.username);
debug('No matching record is found for user %s', query.email || query.username);
fn(defaultError);
}
});