1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Handle httpAdminRoot missing ending slash with login strategy

Fixes #2473
This commit is contained in:
Nick O'Leary 2020-02-24 21:08:29 +00:00
parent 1830478ec3
commit 22de8855c1
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -100,7 +100,10 @@ function login(req,res) {
}
} else if (mergedAdminAuth.type === "strategy") {
var urlPrefix = (settings.httpAdminRoot==='/')?"":settings.httpAdminRoot;
var urlPrefix = (settings.httpAdminRoot||"").replace(/\/$/,"");
if (urlPrefix.length > 0) {
urlPrefix += "/";
}
response = {
"type":"strategy",
"prompts":[{type:"button",label:mergedAdminAuth.strategy.label, url: urlPrefix + "auth/strategy"}]