set the port correctly
This commit is contained in:
@ -110,14 +110,16 @@ setup = (user) ->
|
|||||||
if response.ok
|
if response.ok
|
||||||
response.json().then (json) ->
|
response.json().then (json) ->
|
||||||
settings = json
|
settings = json
|
||||||
|
if settings.wikiHost
|
||||||
|
dialogHost = settings.wikiHost
|
||||||
|
else
|
||||||
|
dialogHost = window.location.hostname
|
||||||
if settings.useHttps
|
if settings.useHttps
|
||||||
dialogProtocol = 'https:'
|
dialogProtocol = 'https:'
|
||||||
else
|
else
|
||||||
dialogProtocol = window.location.protocol
|
dialogProtocol = window.location.protocol
|
||||||
if settings.wikiHost
|
if window.location.port
|
||||||
dialogHost = settings.wikiHost
|
dialogHost = dialogHost + ':' + window.location.port
|
||||||
else
|
|
||||||
dialogHost = window.location.host
|
|
||||||
if settings.usingPersona
|
if settings.usingPersona
|
||||||
settings.dialogURL = dialogProtocol + '//' + dialogHost + '/auth/personaLogin'
|
settings.dialogURL = dialogProtocol + '//' + dialogHost + '/auth/personaLogin'
|
||||||
else
|
else
|
||||||
|
@ -53,6 +53,8 @@ module.exports = exports = (log, loga, argv) ->
|
|||||||
|
|
||||||
if wikiHost
|
if wikiHost
|
||||||
callbackHost = wikiHost
|
callbackHost = wikiHost
|
||||||
|
if url.parse(argv.url).port
|
||||||
|
callbackHost = callbackHost + ":" + url.parse(argv.url).port
|
||||||
else
|
else
|
||||||
callbackHost = url.parse(argv.url).host
|
callbackHost = url.parse(argv.url).host
|
||||||
|
|
||||||
@ -285,7 +287,10 @@ module.exports = exports = (log, loga, argv) ->
|
|||||||
when "google" then schemeButtons.push({button: "<a href='/auth/google' class='scheme-button google-button'><span>Google</span></a>"})
|
when "google" then schemeButtons.push({button: "<a href='/auth/google' class='scheme-button google-button'><span>Google</span></a>"})
|
||||||
|
|
||||||
info = {
|
info = {
|
||||||
wikiName: url.parse(referer).hostname
|
wikiName: if useHttps
|
||||||
|
url.parse(referer).hostname
|
||||||
|
else
|
||||||
|
url.parse(referer).host
|
||||||
wikiHostName: if wikiHost
|
wikiHostName: if wikiHost
|
||||||
"part of " + req.hostname + " wiki farm"
|
"part of " + req.hostname + " wiki farm"
|
||||||
else
|
else
|
||||||
@ -317,7 +322,10 @@ module.exports = exports = (log, loga, argv) ->
|
|||||||
});
|
});
|
||||||
</script>"})
|
</script>"})
|
||||||
info = {
|
info = {
|
||||||
wikiName: url.parse(referer).hostname
|
wikiName: if useHttps
|
||||||
|
url.parse(referer).hostname
|
||||||
|
else
|
||||||
|
url.parse(referer).host
|
||||||
wikiHostName: if wikiHost
|
wikiHostName: if wikiHost
|
||||||
"part of " + req.hostname + " wiki farm"
|
"part of " + req.hostname + " wiki farm"
|
||||||
else
|
else
|
||||||
@ -329,7 +337,10 @@ module.exports = exports = (log, loga, argv) ->
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
info = {
|
info = {
|
||||||
wikiName: url.parse(referer).hostname
|
wikiName: if useHttps
|
||||||
|
url.parse(referer).hostname
|
||||||
|
else
|
||||||
|
url.parse(referer).host
|
||||||
wikiHostName: if wikiHost
|
wikiHostName: if wikiHost
|
||||||
"part of " + req.hostname + " wiki farm"
|
"part of " + req.hostname + " wiki farm"
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user