feat: removed registerAndLoginUserCallback local helper, added handling if a bad interstitial doesn't go away nor throw errors

v1.18.x
Julian Lam 4 years ago
parent 46243719b7
commit 70a04bc105

@ -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 session
const payload = req.session.registration;

Loading…
Cancel
Save