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
1 changed files with 4 additions and 1 deletions

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"}]