diff --git a/src/user/profile.js b/src/user/profile.js index a516b30074..e588d147d0 100644 --- a/src/user/profile.js +++ b/src/user/profile.js @@ -70,6 +70,7 @@ module.exports = function(User) { if (!data.username) { return next(); } + data.username = data.username.trim(); User.getUserFields(uid, ['username', 'userslug'], function(err, userData) { if (err) { return next(err);