From 1d9cfe1e966c8024776e85e1e9d62f51299ef3c6 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 17 May 2021 10:50:50 -0400 Subject: [PATCH] fix: bug where interstitial errors were not properly passed to the front-end via req.flash --- src/controllers/authentication.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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`);