Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Add some abstraction to local strategy login error
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrodrigues committed May 28, 2015
1 parent 3ea400f commit e11ffda
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions modules/users/server/config/strategies/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@ module.exports = function() {
if (err) {
return done(err);
}
if (!user) {
if (!user || !user.authenticate(password)) {
return done(null, false, {
message: 'Unknown user'
});
}
if (!user.authenticate(password)) {
return done(null, false, {
message: 'Invalid password'
message: 'Invalid username or password'
});
}

Expand Down

0 comments on commit e11ffda

Please sign in to comment.