This commit is contained in:
Julian Lam
2016-11-23 11:45:29 -05:00
parent 4ff71f6b0b
commit cafbdfd83e
2 changed files with 9 additions and 1 deletions

View File

@@ -387,7 +387,11 @@ authenticationController.localLogin = function (req, username, password, next) {
// Retrieve ban reason and show error
return user.getLatestBanInfo(uid, function (err, banInfo) {
if (err) {
next(err);
if (err.message === 'no-ban-info') {
next(new Error('[[error:user-banned]]'));
} else {
next(err);
}
} else if (banInfo.reason) {
next(new Error('[[error:user-banned-reason, ' + banInfo.reason + ']]'));
} else {