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

Ensure strategy login button uses relative URL

Fixes #1481
This commit is contained in:
Nick O'Leary 2017-12-04 21:13:07 +00:00
parent d7f0102aa2
commit 5e128f89f6
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -87,9 +87,11 @@ function login(req,res) {
"prompts":[{id:"username",type:"text",label:"user.username"},{id:"password",type:"password",label:"user.password"}] "prompts":[{id:"username",type:"text",label:"user.username"},{id:"password",type:"password",label:"user.password"}]
} }
} else if (settings.adminAuth.type === "strategy") { } else if (settings.adminAuth.type === "strategy") {
var urlPrefix = (settings.httpAdminRoot==='/')?"":settings.httpAdminRoot;
response = { response = {
"type":"strategy", "type":"strategy",
"prompts":[{type:"button",label:settings.adminAuth.strategy.label, url: settings.httpAdminRoot + "auth/strategy"}] "prompts":[{type:"button",label:settings.adminAuth.strategy.label, url: urlPrefix + "auth/strategy"}]
} }
if (settings.adminAuth.strategy.icon) { if (settings.adminAuth.strategy.icon) {
response.prompts[0].icon = settings.adminAuth.strategy.icon; response.prompts[0].icon = settings.adminAuth.strategy.icon;