fix: closes #14151, handle null req.body

This commit is contained in:
Barış Soner Uşaklı
2026-04-06 17:19:55 -04:00
parent 7a0443c50a
commit 5d5490d36a
2 changed files with 16 additions and 0 deletions

View File

@@ -221,6 +221,7 @@ authenticationController.login = async (req, res, next) => {
}
const loginWith = meta.config.allowLoginWith || 'username-email';
req.body = req.body || {};
req.body.username = String(req.body.username).trim();
const errorHandler = res.locals.noScriptErrors || helpers.noScriptErrors;
try {