From a428f92dfcc6cd7e686f5d7513682a61c6a70647 Mon Sep 17 00:00:00 2001 From: Paul Rodwell Date: Sat, 28 May 2016 09:51:15 +0100 Subject: [PATCH] set the port correctly --- client/security.coffee | 10 ++++++---- server/social.coffee | 17 ++++++++++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/client/security.coffee b/client/security.coffee index df4ce87..4823f59 100644 --- a/client/security.coffee +++ b/client/security.coffee @@ -110,14 +110,16 @@ setup = (user) -> if response.ok response.json().then (json) -> settings = json + if settings.wikiHost + dialogHost = settings.wikiHost + else + dialogHost = window.location.hostname if settings.useHttps dialogProtocol = 'https:' else dialogProtocol = window.location.protocol - if settings.wikiHost - dialogHost = settings.wikiHost - else - dialogHost = window.location.host + if window.location.port + dialogHost = dialogHost + ':' + window.location.port if settings.usingPersona settings.dialogURL = dialogProtocol + '//' + dialogHost + '/auth/personaLogin' else diff --git a/server/social.coffee b/server/social.coffee index 08e8f33..cdf47ec 100644 --- a/server/social.coffee +++ b/server/social.coffee @@ -53,6 +53,8 @@ module.exports = exports = (log, loga, argv) -> if wikiHost callbackHost = wikiHost + if url.parse(argv.url).port + callbackHost = callbackHost + ":" + url.parse(argv.url).port else callbackHost = url.parse(argv.url).host @@ -285,7 +287,10 @@ module.exports = exports = (log, loga, argv) -> when "google" then schemeButtons.push({button: "Google"}) info = { - wikiName: url.parse(referer).hostname + wikiName: if useHttps + url.parse(referer).hostname + else + url.parse(referer).host wikiHostName: if wikiHost "part of " + req.hostname + " wiki farm" else @@ -317,7 +322,10 @@ module.exports = exports = (log, loga, argv) -> }); "}) info = { - wikiName: url.parse(referer).hostname + wikiName: if useHttps + url.parse(referer).hostname + else + url.parse(referer).host wikiHostName: if wikiHost "part of " + req.hostname + " wiki farm" else @@ -329,7 +337,10 @@ module.exports = exports = (log, loga, argv) -> } else info = { - wikiName: url.parse(referer).hostname + wikiName: if useHttps + url.parse(referer).hostname + else + url.parse(referer).host wikiHostName: if wikiHost "part of " + req.hostname + " wiki farm" else