From e11ffda6e5b5a8156dade30503c04d87233011a2 Mon Sep 17 00:00:00 2001 From: Pedro Rodrigues Date: Thu, 28 May 2015 16:56:49 +0100 Subject: [PATCH] Add some abstraction to local strategy login error --- modules/users/server/config/strategies/local.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/users/server/config/strategies/local.js b/modules/users/server/config/strategies/local.js index 89e655e805..50ad14f142 100644 --- a/modules/users/server/config/strategies/local.js +++ b/modules/users/server/config/strategies/local.js @@ -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' }); }