From e845c34b52948ff265879770cbad749c7269ae48 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 13 Apr 2021 21:31:32 -0400 Subject: [PATCH] fix: registration interstitials not handling promise rejections properly --- 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 79cc5aa290..a9263ffe72 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.reason && result.reason.message).filter(Boolean); + const errors = results.map(result => result.status === 'rejected').filter(Boolean); if (errors.length) { req.flash('errors', errors); return res.redirect(`${nconf.get('relative_path')}/register/complete`);