Skip to content

Node.js based forum software built for the modern web

feat: allow registration interstitial abort to also follow returnTo

Julian Lamb3c916414bbb
diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js
index 5b8e13365b..4e11ddaa1e 100644
--- a/src/controllers/authentication.js
+++ b/src/controllers/authentication.js
@@ -219,9 +219,9 @@ authenticationController.registerComplete = function (req, res, next) {
authenticationController.registerAbort = function (req, res) {
if (req.uid) {
- // Clear interstitial data and go home
+ // Clear interstitial data and continue on...
delete req.session.registration;
- res.redirect(`${nconf.get('relative_path')}/`);
+ res.redirect(nconf.get('relative_path') + req.session.returnTo);
} else {
// End the session and redirect to home
req.session.destroy(() => {