From 157bea6966fce23881632b2934ced9ddb30d56f5 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 30 Oct 2018 17:09:27 -0400 Subject: [PATCH] fix: username trim on login, closes #6894 --- src/controllers/authentication.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index 1c3e1b4ab0..2ce06ca683 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -224,6 +224,7 @@ authenticationController.login = function (req, res, next) { } var loginWith = meta.config.allowLoginWith || 'username-email'; + req.body.username = req.body.username.trim(); if (req.body.username && utils.isEmailValid(req.body.username) && loginWith.includes('email')) { async.waterfall([