mirror of
https://github.com/Foltik/Shimapan
synced 2025-01-07 08:42:49 -05:00
Allow canonicalize to take either displayname or username from request
This commit is contained in:
parent
4770fd3178
commit
7d39001a01
@ -3,6 +3,9 @@ exports.canonicalize = displayname => displayname.normalize('NFKD').toLowerCase(
|
|||||||
|
|
||||||
exports.canonicalizeRequest =
|
exports.canonicalizeRequest =
|
||||||
(req, res, next) => {
|
(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();
|
next();
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user