Skip to content

Commit

Permalink
fix(login): username whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Jan 27, 2019
1 parent 4f24c8c commit 282d725
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/passport/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 282d725

Please sign in to comment.