mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	use uid instead of socket.uid
This commit is contained in:
		| @@ -84,16 +84,19 @@ SocketUser.reset.send = function(socket, email, callback) { | |||||||
| }; | }; | ||||||
|  |  | ||||||
| SocketUser.reset.commit = function(socket, data, callback) { | SocketUser.reset.commit = function(socket, data, callback) { | ||||||
| 	if(data && data.code && data.password) { | 	if (!data || !data.code || !data.password) { | ||||||
| 		async.series([ | 		return callback(new Error('[[error:invalid-data]]')); | ||||||
| 			async.apply(db.getObjectField, 'reset:uid', data.code), | 	} | ||||||
| 			async.apply(user.reset.commit, data.code, data.password) |  | ||||||
| 		], function(err, data) { | 	async.parallel({ | ||||||
|  | 		uid: async.apply(db.getObjectField, 'reset:uid', data.code), | ||||||
|  | 		reset: async.apply(user.reset.commit, data.code, data.password) | ||||||
|  | 	}, function(err, results) { | ||||||
| 		if (err) { | 		if (err) { | ||||||
| 			return callback(err); | 			return callback(err); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 			var uid = data[0], | 		var uid = results.uid, | ||||||
| 			now = new Date(), | 			now = new Date(), | ||||||
| 			parsedDate = now.getFullYear() + '/' + (now.getMonth()+1) + '/' + now.getDate(); | 			parsedDate = now.getFullYear() + '/' + (now.getMonth()+1) + '/' + now.getDate(); | ||||||
|  |  | ||||||
| @@ -105,14 +108,14 @@ SocketUser.reset.commit = function(socket, data, callback) { | |||||||
| 				subject: '[[email:reset.notify.subject]]' | 				subject: '[[email:reset.notify.subject]]' | ||||||
| 			}); | 			}); | ||||||
| 		}); | 		}); | ||||||
|  |  | ||||||
| 		events.log({ | 		events.log({ | ||||||
| 			type: 'password-reset', | 			type: 'password-reset', | ||||||
| 				uid: socket.uid, | 			uid: uid, | ||||||
| 			ip: socket.ip | 			ip: socket.ip | ||||||
| 		}); | 		}); | ||||||
| 		callback(); | 		callback(); | ||||||
| 	}); | 	}); | ||||||
| 	} |  | ||||||
| }; | }; | ||||||
|  |  | ||||||
| SocketUser.checkStatus = function(socket, uid, callback) { | SocketUser.checkStatus = function(socket, uid, callback) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user