mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	more fixes
This commit is contained in:
		| @@ -126,7 +126,12 @@ | ||||
| 	//hashes | ||||
|  | ||||
| 	module.setObject = function(key, data, callback) { | ||||
| 		redisClient.hmset(key, data, callback); | ||||
| 		// TODO: this crashes if callback isnt supplied -baris | ||||
| 		redisClient.hmset(key, data, function(err, res) { | ||||
| 			if(callback) { | ||||
| 				callback(err, res); | ||||
| 			} | ||||
| 		}); | ||||
| 	} | ||||
|  | ||||
| 	module.setObjectField = function(key, field, value, callback) { | ||||
|   | ||||
| @@ -43,6 +43,7 @@ var user = require('./user'), | ||||
| 						} | ||||
|  | ||||
| 						if (res) { | ||||
| 							console.log('logged in', uid); | ||||
| 							next(null, { | ||||
| 								user: { | ||||
| 									uid: uid | ||||
|   | ||||
| @@ -14,8 +14,12 @@ | ||||
|  | ||||
| 	passport.use(new passportLocal(function(user, password, next) { | ||||
| 		login_module.loginViaLocal(user, password, function(err, login) { | ||||
| 			if (!err) next(null, login.user); | ||||
| 			else next(null, false, err); | ||||
| 			if (!err) { | ||||
| 				console.log('LOGGED IN'); | ||||
| 				next(null, login.user); | ||||
| 			} else { | ||||
| 				next(null, false, err); | ||||
| 			} | ||||
| 		}); | ||||
| 	})); | ||||
|  | ||||
| @@ -189,7 +193,9 @@ | ||||
| 		}); | ||||
|  | ||||
| 		app.post('/register', function(req, res) { | ||||
| 			console.log('CALLING USER CREATE'); | ||||
| 			user.create(req.body.username, req.body.password, req.body.email, function(err, uid) { | ||||
| 				console.log('USER CREATE DONE', err, uid); | ||||
| 				if (err === null && uid) { | ||||
| 					req.login({ | ||||
| 						uid: uid | ||||
|   | ||||
| @@ -68,7 +68,7 @@ var bcrypt = require('bcrypt'), | ||||
| 				return callback(err); | ||||
| 			} | ||||
|  | ||||
| 			db.incrObjectField('global', 'nextUserId', function(err, uid) { | ||||
| 			db.incrObjectField('global', 'nextUid', function(err, uid) { | ||||
| 				if(err) { | ||||
| 					return callback(err); | ||||
| 				} | ||||
| @@ -103,7 +103,7 @@ var bcrypt = require('bcrypt'), | ||||
|  | ||||
| 				if (email !== undefined) { | ||||
| 					db.setObjectField('email:uid', email, uid); | ||||
| 					User.sendConfirmationEmail(email); | ||||
| 					//User.sendConfirmationEmail(email); | ||||
| 				} | ||||
|  | ||||
| 				plugins.fireHook('action:user.create', {uid: uid, username: username, email: email, picture: gravatar, timestamp: timestamp}); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user