Remove automatic appstore account signup in setup view

This commit is contained in:
Johannes Zellner
2017-01-29 14:39:54 -08:00
parent 04e13eac55
commit 4cadffa6ea
2 changed files with 1 additions and 31 deletions

View File

@@ -20,24 +20,10 @@ app.controller('SetupController', ['$scope', '$http', 'Client', function ($scope
$scope.provider = '';
$scope.apiServerOrigin = '';
$scope.setupToken = '';
$scope.createAppstoreAccount = true;
$scope.activateCloudron = function () {
$scope.busy = true;
function registerAppstoreAccountIfNeeded(callback) {
if (!$scope.createAppstoreAccount) return callback(null);
if ($scope.provider === 'caas') return callback(null);
$http.post($scope.apiServerOrigin + '/api/v1/users', { email: $scope.account.email, password: $scope.account.password }).success(function (data, status) {
if (status !== 201) return callback({ status: status, data: data });
Client.setAppstoreConfig({ userId: data.userId, token: data.accessToken }, callback);
}).error(function (data, status) {
callback({ status: status, data: data });
});
}
Client.createAdmin($scope.account.username, $scope.account.password, $scope.account.email, $scope.account.displayName, $scope.setupToken, function (error) {
if (error) {
console.error('Internal error', error);
@@ -46,11 +32,7 @@ app.controller('SetupController', ['$scope', '$http', 'Client', function ($scope
return;
}
registerAppstoreAccountIfNeeded(function (error) {
if (error) console.error('Unable to create appstore account.', error); // this is not fatal
window.location.href = '/';
});
window.location.href = '/';
});
};
@@ -89,7 +71,6 @@ app.controller('SetupController', ['$scope', '$http', 'Client', function ($scope
}
$scope.setupToken = search.setupToken;
$scope.createAppstoreAccount = false;
}
$scope.account.email = search.email || $scope.account.email;

View File

@@ -79,17 +79,6 @@
</div>
</div>
</div>
<div class="row" ng-hide="provider === 'caas'">
<div class="col-md-12 text-center">
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" ng-model="createAppstoreAccount"> Create <a href="https://cloudron.io" target="_blank">Cloudron Store</a> account
</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 text-center">
<input type="submit" class="btn btn-primary" ng-disabled="setupForm.$invalid" value="Done">