Skip to content

Node.js based forum software built for the modern web

Replace only base URL in login redirect URL, fixes #5205

Stuart Williamsf92758c7647a
diff --git a/src/controllers/index.js b/src/controllers/index.js
index 2671dc0657..a8cfa96d89 100644
--- a/src/controllers/index.js
+++ b/src/controllers/index.js
@@ -104,7 +104,7 @@ Controllers.login = function (req, res, next) {
var registrationType = meta.config.registrationType || 'normal';
var allowLoginWith = (meta.config.allowLoginWith || 'username-email');
- var returnTo = (req.headers['x-return-to'] || '').replace(nconf.get('url'), '');
+ var returnTo = (req.headers['x-return-to'] || '').replace(nconf.get('base_url'), '');
var errorText;
if (req.query.error === 'csrf-invalid') {