mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +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); | 	const userslug = slugify(username); | ||||||
|  | 	if (!utils.isUserNameValid(username) || !userslug) { | ||||||
|  | 		return next(new Error('[[error:invalid-username]]')); | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	const uid = await user.getUidByUserslug(userslug); | 	const uid = await user.getUidByUserslug(userslug); | ||||||
| 	try { | 	try { | ||||||
| 		const [userData, isAdminOrGlobalMod, canLoginIfBanned] = await Promise.all([ | 		const [userData, isAdminOrGlobalMod, canLoginIfBanned] = await Promise.all([ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user