Do not continue processing after redirect

This commit is contained in:
Girish Ramakrishnan
2023-08-11 11:43:26 +05:30
parent 1041b3b8ab
commit cd0b51dac2
2 changed files with 11 additions and 7 deletions
+6 -4
View File
@@ -74,19 +74,21 @@ app.controller('SetupController', ['$scope', 'Client', function ($scope, Client)
// if we are here from https://ip/setup.html ,go to https://admin/setup.html
if (status.adminFqdn && status.adminFqdn !== window.location.hostname) {
window.location.href = 'https://' + status.adminFqdn + '/setup.html';
return;
return true;
}
// if we don't have a domain yet, first go to domain setup
if (!status.adminFqdn) {
window.location.href = '/setupdns.html';
return;
return true;
}
if (status.activated) {
window.location.href = '/';
return;
return true;
}
return false;
}
function setView(view) {
@@ -101,7 +103,7 @@ app.controller('SetupController', ['$scope', 'Client', function ($scope, Client)
Client.getProvisionStatus(function (error, status) {
if (error) return Client.initError(error, init);
redirectIfNeeded(status);
if (redirectIfNeeded(status)) return;
setView(search.view);
$scope.setupToken = search.setupToken;