mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	feat(emails): pass req in to filter:registration.interstitial
This commit is contained in:
		| @@ -28,6 +28,7 @@ async function registerAndLoginUser(req, res, userData) { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	const data = await plugins.hooks.fire('filter:register.interstitial', { | 	const data = await plugins.hooks.fire('filter:register.interstitial', { | ||||||
|  | 		req, | ||||||
| 		userData, | 		userData, | ||||||
| 		interstitials: [], | 		interstitials: [], | ||||||
| 	}); | 	}); | ||||||
| @@ -141,6 +142,7 @@ async function addToApprovalQueue(req, userData) { | |||||||
| authenticationController.registerComplete = function (req, res, next) { | authenticationController.registerComplete = function (req, res, next) { | ||||||
| 	// For the interstitials that respond, execute the callback with the form body | 	// For the interstitials that respond, execute the callback with the form body | ||||||
| 	plugins.hooks.fire('filter:register.interstitial', { | 	plugins.hooks.fire('filter:register.interstitial', { | ||||||
|  | 		req, | ||||||
| 		userData: req.session.registration, | 		userData: req.session.registration, | ||||||
| 		interstitials: [], | 		interstitials: [], | ||||||
| 	}, async (err, data) => { | 	}, async (err, data) => { | ||||||
|   | |||||||
| @@ -193,6 +193,7 @@ Controllers.registerInterstitial = async function (req, res, next) { | |||||||
| 	} | 	} | ||||||
| 	try { | 	try { | ||||||
| 		const data = await plugins.hooks.fire('filter:register.interstitial', { | 		const data = await plugins.hooks.fire('filter:register.interstitial', { | ||||||
|  | 			req, | ||||||
| 			userData: req.session.registration, | 			userData: req.session.registration, | ||||||
| 			interstitials: [], | 			interstitials: [], | ||||||
| 		}); | 		}); | ||||||
|   | |||||||
| @@ -270,7 +270,7 @@ module.exports = function (middleware) { | |||||||
| 		}); | 		}); | ||||||
| 		if (!allowed.includes(path)) { | 		if (!allowed.includes(path)) { | ||||||
| 			// Append user data if present | 			// Append user data if present | ||||||
| 			req.session.registration.uid = req.uid; | 			req.session.registration.uid = req.session.registration.uid || req.uid; | ||||||
|  |  | ||||||
| 			controllers.helpers.redirect(res, '/register/complete'); | 			controllers.helpers.redirect(res, '/register/complete'); | ||||||
| 		} else { | 		} else { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user