Show actionable notification in case we miss aws credentials

Fixes #553
This commit is contained in:
Johannes Zellner
2016-01-14 16:01:08 +01:00
parent a92d4f2af7
commit 0601ea2f39

View File

@@ -105,6 +105,19 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
$scope.config = Client.getConfig();
$scope.initialized = true;
// check if we have aws credentials if selfhosting
if ($scope.config.isCustomDomain) {
Client.getDnsConfig(function (error, result) {
if (error) return console.error(error);
if (result.provider === 'route53' && (!result.accessKeyId || !result.secretAccessKey)) {
var actionScope = $scope.$new(true);
actionScope.action = '/#/certs';
Client.notify('Missing AWS credentials', 'Please provide AWS credentials, click here to add them.', true, actionScope);
}
});
}
});
});
});