Skip to content

Node.js based forum software built for the modern web

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

Julian Lam1d9cfe1e966c
diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js
index f5d44dec36..54415ee928 100644
--- a/src/controllers/authentication.js
+++ b/src/controllers/authentication.js
@@ -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`);