From ac1b9692f2bccbf8420224f152535c238404ef53 Mon Sep 17 00:00:00 2001 From: gasoved Date: Sun, 26 Sep 2021 13:06:29 +0300 Subject: [PATCH] fix: handle undefined returnTo on registerAbort --- 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 f45cce94fc..b2ca8e056e 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -220,7 +220,7 @@ authenticationController.registerAbort = function (req, res) { if (req.uid) { // Clear interstitial data and continue on... delete req.session.registration; - res.redirect(nconf.get('relative_path') + req.session.returnTo); + res.redirect(nconf.get('relative_path') + (req.session.returnTo || '/')); } else { // End the session and redirect to home req.session.destroy(() => {