mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	fix: do not throw if password passed into isPasswordCorrect is invalid, just return false
				
					
				
			This commit is contained in:
		| @@ -26,7 +26,12 @@ module.exports = function (User) { | ||||
| 			hashedPassword = ''; | ||||
| 		} | ||||
|  | ||||
| 		User.isPasswordValid(password, 0); | ||||
| 		try { | ||||
| 			User.isPasswordValid(password, 0); | ||||
| 		} catch (e) { | ||||
| 			return false; | ||||
| 		} | ||||
|  | ||||
| 		await User.auth.logAttempt(uid, ip); | ||||
| 		const ok = await Password.compare(password, hashedPassword, !!parseInt(shaWrapped, 10)); | ||||
| 		if (ok) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user