diff --git a/app/util/canonicalize.js b/app/util/canonicalize.js index 38f7040..805981b 100644 --- a/app/util/canonicalize.js +++ b/app/util/canonicalize.js @@ -3,6 +3,9 @@ exports.canonicalize = displayname => displayname.normalize('NFKD').toLowerCase( exports.canonicalizeRequest = (req, res, next) => { - req.body.username = req.body.displayname ? exports.canonicalize(req.body.displayname) : undefined; + if (req.body.displayname) + req.body.username = exports.canonicalize(req.body.displayname); + else if (req.body.username) + req.body.username = exports.canonicalize(req.body.username); next(); }; \ No newline at end of file