mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	closes #6435
This commit is contained in:
		| @@ -152,7 +152,12 @@ authenticationController.registerComplete = function (req, res, next) { | |||||||
|  |  | ||||||
| 		var callbacks = data.interstitials.reduce(function (memo, cur) { | 		var callbacks = data.interstitials.reduce(function (memo, cur) { | ||||||
| 			if (cur.hasOwnProperty('callback') && typeof cur.callback === 'function') { | 			if (cur.hasOwnProperty('callback') && typeof cur.callback === 'function') { | ||||||
| 				memo.push(async.apply(cur.callback, req.session.registration, req.body)); | 				memo.push(function (next) { | ||||||
|  | 					cur.callback(req.session.registration, req.body, function (err) { | ||||||
|  | 						// Pass error as second argument so all callbacks are executed | ||||||
|  | 						next(null, err); | ||||||
|  | 					}); | ||||||
|  | 				}); | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			return memo; | 			return memo; | ||||||
| @@ -170,9 +175,11 @@ authenticationController.registerComplete = function (req, res, next) { | |||||||
| 			} | 			} | ||||||
| 		}; | 		}; | ||||||
|  |  | ||||||
| 		async.parallel(callbacks, function (err) { | 		async.parallel(callbacks, function (_blank, err) { | ||||||
| 			if (err) { | 			if (err.length) { | ||||||
| 				req.flash('error', err.message); | 				req.flash('errors', err.filter(Boolean).map(function (err) { | ||||||
|  | 					return err.message; | ||||||
|  | 				})); | ||||||
| 				return res.redirect(nconf.get('relative_path') + '/register/complete'); | 				return res.redirect(nconf.get('relative_path') + '/register/complete'); | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -207,7 +207,7 @@ Controllers.registerInterstitial = function (req, res, next) { | |||||||
| 			async.parallel(renders, next); | 			async.parallel(renders, next); | ||||||
| 		}, | 		}, | ||||||
| 		function (sections) { | 		function (sections) { | ||||||
| 			var errors = req.flash('error'); | 			var errors = req.flash('errors'); | ||||||
| 			res.render('registerComplete', { | 			res.render('registerComplete', { | ||||||
| 				title: '[[pages:registration-complete]]', | 				title: '[[pages:registration-complete]]', | ||||||
| 				errors: errors, | 				errors: errors, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user