From bd65e1f35d3034e963ebcddbb9b8d6558b5cf789 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Fri, 6 Jan 2017 17:25:24 +0100 Subject: [PATCH] Put some redirects in the setup pages to end up in the correct one always --- webadmin/src/js/setup.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/webadmin/src/js/setup.js b/webadmin/src/js/setup.js index 7ce960805..d129207a7 100644 --- a/webadmin/src/js/setup.js +++ b/webadmin/src/js/setup.js @@ -60,11 +60,23 @@ app.controller('SetupController', ['$scope', '$http', 'Client', function ($scope return; } + // if we are here from the ip first go to the real domain if already setup + if (status.provider !== 'caas' && status.configState.domain && status.configState.domain !== window.location.hostname) { + window.location.href = 'https://my.' + status.configState.domain + '/setup.html'; + return; + } + if (status.activated) { window.location.href = '/'; return; } + // if we don't have a domain yet, first go to domain setup + if (!status.configState.domain) { + window.location.href = '/setupdns.html'; + return; + } + if (status.provider === 'caas') { if (!search.setupToken) { window.location.href = '/error.html?errorCode=2';