From 282d7255c52f9d84f40e94358133c62aaf740c2d Mon Sep 17 00:00:00 2001 From: Chris Brame Date: Sun, 27 Jan 2019 01:20:11 -0500 Subject: [PATCH] fix(login): username whitespaces --- src/passport/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/passport/index.js b/src/passport/index.js index e6a9116cb..7b57ecda4 100644 --- a/src/passport/index.js +++ b/src/passport/index.js @@ -38,7 +38,7 @@ module.exports = function () { passReqToCallback: true }, function (req, username, password, done) { - User.findOne({ username: new RegExp('^' + username + '$', 'i') }) + User.findOne({ username: new RegExp('^' + username.trim() + '$', 'i') }) .select('+password +tOTPKey +tOTPPeriod') .exec(function (err, user) { if (err) {