mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	fix: #8974, with password login for approval queue
This commit is contained in:
		| @@ -66,7 +66,10 @@ module.exports = function (User) { | ||||
| 		} | ||||
| 		const creation_time = await db.sortedSetScore('registration:queue', username); | ||||
| 		const uid = await User.create(userData); | ||||
| 		await User.setUserField(uid, 'password', userData.hashedPassword); | ||||
| 		await User.setUserFields(uid, { | ||||
| 			password: userData.hashedPassword, | ||||
| 			'password:shaWrapped': 1, | ||||
| 		}); | ||||
| 		await removeFromQueue(username); | ||||
| 		await markNotificationRead(username); | ||||
| 		await plugins.hooks.fire('filter:register.complete', { uid: uid }); | ||||
|   | ||||
| @@ -17,7 +17,10 @@ module.exports = function (User) { | ||||
|  | ||||
| 	User.isPasswordCorrect = async function (uid, password, ip) { | ||||
| 		password = password || ''; | ||||
| 		var { password: hashedPassword, 'password:shaWrapped': shaWrapped } = await db.getObjectFields('user:' + uid, ['password', 'password:shaWrapped']); | ||||
| 		var { | ||||
| 			password: hashedPassword, | ||||
| 			'password:shaWrapped': shaWrapped, | ||||
| 		} = await db.getObjectFields('user:' + uid, ['password', 'password:shaWrapped']); | ||||
| 		if (!hashedPassword) { | ||||
| 			// Non-existant user, submit fake hash for comparison | ||||
| 			hashedPassword = ''; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user