pass env=dev as search param to set the tlsConfig

This commit is contained in:
Girish Ramakrishnan
2018-01-31 20:51:25 -08:00
parent 182085d3f8
commit f51c2e7b61
3 changed files with 18 additions and 9 deletions
+4 -1
View File
@@ -22,6 +22,9 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f
$scope.explicitZone = search.zone || '';
$scope.isDomain = false;
$scope.isSubdomain = false;
$scope.tlsConfig = {
provider: search.env === 'dev' ? 'letsencrypt-staging' : 'letsencrypt-prod'
};
// If we migrate the api origin we have to poll the new location
if (search.admin_fqdn) Client.apiOrigin = 'https://' + search.admin_fqdn;
@@ -122,7 +125,7 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f
data.token = $scope.dnsCredentials.cloudflareToken;
}
Client.setupDnsConfig($scope.dnsCredentials.domain, $scope.explicitZone, provider, data, function (error) {
Client.setupDnsConfig($scope.dnsCredentials.domain, $scope.explicitZone, provider, data, $scope.tlsConfig, function (error) {
if (error && error.statusCode === 403) {
$scope.dnsCredentials.busy = false;
$scope.error = 'Wrong instance id provided.';