mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	feat: removed registerAndLoginUserCallback local helper, added handling if a bad interstitial doesn't go away nor throw errors
This commit is contained in:
		| @@ -73,9 +73,6 @@ async function registerAndLoginUser(req, res, userData) { | |||||||
| 	return complete; | 	return complete; | ||||||
| } | } | ||||||
|  |  | ||||||
| const registerAndLoginUserCallback = util.callbackify(registerAndLoginUser); |  | ||||||
|  |  | ||||||
|  |  | ||||||
| authenticationController.register = async function (req, res) { | authenticationController.register = async function (req, res) { | ||||||
| 	const registrationType = meta.config.registrationType || 'normal'; | 	const registrationType = meta.config.registrationType || 'normal'; | ||||||
|  |  | ||||||
| @@ -197,7 +194,12 @@ authenticationController.registerComplete = function (req, res, next) { | |||||||
|  |  | ||||||
| 		if (req.session.registration.register === true) { | 		if (req.session.registration.register === true) { | ||||||
| 			res.locals.processLogin = true; | 			res.locals.processLogin = true; | ||||||
| 			registerAndLoginUserCallback(req, res, req.session.registration, done); | 			req.body.noscript = 'true';	// trigger full page load on error | ||||||
|  |  | ||||||
|  | 			const data = await registerAndLoginUser(req, res, req.session.registration); | ||||||
|  | 			if (!data) { | ||||||
|  | 				winston.warn('[register] Interstitial callbacks processed with no errors, but one or more interstitials remain. This is likely an issue with one of the interstitials not properly handling a null case or invalid value.'); | ||||||
|  | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			// Update user hash, clear registration data in session | 			// Update user hash, clear registration data in session | ||||||
| 			const payload = req.session.registration; | 			const payload = req.session.registration; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user