mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: don\'t begin processing local login if the passed-in username isn't even valid
This commit is contained in:
@@ -420,6 +420,10 @@ authenticationController.localLogin = async function (req, username, password, n
|
||||
}
|
||||
|
||||
const userslug = slugify(username);
|
||||
if (!utils.isUserNameValid(username) || !userslug) {
|
||||
return next(new Error('[[error:invalid-username]]'));
|
||||
}
|
||||
|
||||
const uid = await user.getUidByUserslug(userslug);
|
||||
try {
|
||||
const [userData, isAdminOrGlobalMod, canLoginIfBanned] = await Promise.all([
|
||||
|
||||
Reference in New Issue
Block a user