From e3570e609bdee15bcdc51c378cc1b58d27486f41 Mon Sep 17 00:00:00 2001 From: sablecliff Date: Fri, 1 May 2015 13:01:29 +1000 Subject: [PATCH] Fixes Issue #5103 Altered the error messages that are part of the login and forgotten password processes. These messages now remind the the user that they may have created an account through facebook. --- website/src/controllers/auth.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/src/controllers/auth.js b/website/src/controllers/auth.js index e468aa4975..228f0f7a3e 100644 --- a/website/src/controllers/auth.js +++ b/website/src/controllers/auth.js @@ -138,7 +138,7 @@ api.loginLocal = function(req, res, next) { var login = validator.isEmail(username) ? {'auth.local.email':username} : {'auth.local.username':username}; User.findOne(login, {auth:1}, function(err, user){ if (err) return next(err); - if (!user) return res.json(401, {err:"Username or password incorrect. Click 'Forgot Password' for help with either. (Note: usernames are case-sensitive)"}); + if (!user) return res.json(401, {err:"Uh-oh - your username or password is incorrect.\n- Make sure your username or email is typed correctly.\n- You may have signed up with Facebook, not email. Double-check by trying Facebook login.\n- If you forgot your password, click \"Forgot Password\"."}); if (user.auth.blocked) return res.json(401, accountSuspended(user._id)); // We needed the whole user object first so we can get his salt to encrypt password comparison User.findOne( @@ -146,7 +146,7 @@ api.loginLocal = function(req, res, next) { , {_id:1, apiToken:1} , function(err, user){ if (err) return next(err); - if (!user) return res.json(401,{err:"Username or password incorrect. Click 'Forgot Password' for help with either. (Note: usernames are case-sensitive)"}); + if (!user) return res.json(401,{err:"Uh-oh - your username or password is incorrect.\n- Make sure your username or email is typed correctly.\n- You may have signed up with Facebook, not email. Double-check by trying Facebook login.\n- If you forgot your password, click \"Forgot Password\"."}); res.json({id: user._id,token: user.apiToken}); password = null; }); @@ -227,7 +227,7 @@ api.resetPassword = function(req, res, next){ User.findOne({'auth.local.email': RegexEscape(email)}, function(err, user){ if (err) return next(err); - if (!user) return res.send(401, {err:"Couldn't find a user registered for email " + email}); + if (!user) return res.send(401, {err:"Sorry, we can't find a user registered with email " + email + "\n- Make sure your email address is typed correctly.\n- You may have signed up with Facebook, not email. Double-check by trying Facebook login."}); user.auth.local.salt = salt; user.auth.local.hashed_password = hashed_password; utils.sendEmail({