Make restore work without a domain

Fixes #195
This commit is contained in:
Girish Ramakrishnan
2017-01-23 12:22:02 -08:00
parent 9ab34ee43a
commit 75b60a2949
2 changed files with 7 additions and 6 deletions

View File

@@ -103,7 +103,8 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
Client.getStatus(function (error, status) {
if (error) return $scope.error(error);
if (!status.activated) {
if (!status.adminFqdn) {
console.log('You have on domain, redirecting', status.configState.configured);
window.location.href = status.configState.configured ? '/setup.html' : '/setupdns.html';
return;
}

View File

@@ -66,17 +66,17 @@ app.controller('SetupController', ['$scope', '$http', 'Client', function ($scope
return;
}
if (status.activated) {
window.location.href = '/';
return;
}
// if we don't have a domain yet, first go to domain setup
if (!status.adminFqdn) {
window.location.href = '/setupdns.html';
return;
}
if (status.activated) {
window.location.href = '/';
return;
}
if (status.provider === 'caas') {
if (!search.setupToken) {
window.location.href = '/error.html?errorCode=2';