From 5e5815f0510994bdc1c92d16a86c947176268c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 27 Jul 2020 22:28:07 -0400 Subject: [PATCH] fix: #8515, fix login redirect on subfolder --- src/controllers/authentication.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index b3a4738e4581..c54ebc52c5ff 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -264,7 +264,9 @@ function continueLogin(req, res, next) { await authenticationController.doLogin(req, userData.uid); var destination; if (req.session.returnTo) { - destination = req.session.returnTo; + destination = req.session.returnTo.startsWith('http') ? + req.session.returnTo : + nconf.get('relative_path') + req.session.returnTo; delete req.session.returnTo; } else { destination = nconf.get('relative_path') + '/';