fix: bug where interstitial errors were not properly passed to the front-end via req.flash

v1.18.x
Julian Lam 4 years ago
parent 518157d9fa
commit 1d9cfe1e96

@ -183,7 +183,7 @@ authenticationController.registerComplete = function (req, res, next) {
const results = await Promise.allSettled(callbacks.map(async (cb) => {
await cb(req.session.registration, req.body);
}));
const errors = results.map(result => result.status === 'rejected').filter(Boolean);
const errors = results.map(result => result.status === 'rejected' && result.reason && result.reason.message).filter(Boolean);
if (errors.length) {
req.flash('errors', errors);
return res.redirect(`${nconf.get('relative_path')}/register/complete`);

Loading…
Cancel
Save