From 5e128f89f6f06565d53e631aeead56c0521fa709 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 4 Dec 2017 21:13:07 +0000 Subject: [PATCH] Ensure strategy login button uses relative URL Fixes #1481 --- red/api/auth/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/red/api/auth/index.js b/red/api/auth/index.js index 2096a1581..05dd40706 100644 --- a/red/api/auth/index.js +++ b/red/api/auth/index.js @@ -87,9 +87,11 @@ function login(req,res) { "prompts":[{id:"username",type:"text",label:"user.username"},{id:"password",type:"password",label:"user.password"}] } } else if (settings.adminAuth.type === "strategy") { + + var urlPrefix = (settings.httpAdminRoot==='/')?"":settings.httpAdminRoot; response = { "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) { response.prompts[0].icon = settings.adminAuth.strategy.icon;