fix external auth with loginkey passthrough #4883

Signed-off-by: si458 <simonsmith5521@gmail.com>

si458 committed Jul 17, 2024 at 15:19 UTC b0d9b17e36a5bc30eb6b8aca1793dc4c68044031
1 file changed +3 -1
webserver.js
+3 -1
@@ -2815,7 +2815,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
2815 }
2816 //res.redirect(domain.url); // This does not handle cookie correctly.
2817 res.set('Content-Type', 'text/html');
2818 - res.end('<html><head><meta http-equiv="refresh" content=0;url="' + domain.url + '"></head><body></body></html>');
2818 + let url = domain.url;
2819 + if (Object.keys(req.query).length > 0) { url += "?" + Object.keys(req.query).map(function(key) { return key + "=" + encodeURIComponent(req.query[key]); }).join("&"); }
2820 + res.end('<html><head><meta http-equiv="refresh" content=0;url="' + url + '"></head><body></body></html>');
2821 }
2822
2823 // Indicates that any request to "/" should render "default" or "login" depending on login state