Node.js based forum software built for the modern web
feat: removed registerAndLoginUserCallback local helper, added handling if a bad interstitial doesn't go away nor throw errors
Julian Lam70a04bc10577
diff --git a/src/controllers/authentication.js b/src/controllers/authentication.jsindex 4e11ddaa1e..78a95269ba 100644--- a/src/controllers/authentication.js+++ b/src/controllers/authentication.js@@ -73,9 +73,6 @@ async function registerAndLoginUser(req, res, userData) {return complete;}-const registerAndLoginUserCallback = util.callbackify(registerAndLoginUser);--authenticationController.register = async function (req, res) {const registrationType = meta.config.registrationType || 'normal';@@ -197,7 +194,12 @@ authenticationController.registerComplete = function (req, res, next) {if (req.session.registration.register === 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 {// Update user hash, clear registration data in sessionconst payload = req.session.registration;