Only attempt to load the license for the setup tool once there is a valid user

Prevents the 401 session expired box from appearing
This commit is contained in:
Joseph Schorr 2016-10-17 21:39:22 -04:00
parent ee96693252
commit 7a6fb7554d
2 changed files with 7 additions and 2 deletions

View file

@ -1257,7 +1257,7 @@ angular.module("core-config-setup", ['angularFileUpload'])
restrict: 'C', restrict: 'C',
scope: { scope: {
}, },
controller: function($scope, $element, ApiService) { controller: function($scope, $element, ApiService, UserService) {
$scope.state = 'loading-license'; $scope.state = 'loading-license';
$scope.showingEditor = false; $scope.showingEditor = false;
$scope.requiredBox = ''; $scope.requiredBox = '';
@ -1276,7 +1276,11 @@ angular.module("core-config-setup", ['angularFileUpload'])
}); });
}; };
loadLicense(); UserService.updateUserIn($scope, function(user) {
if (!user.anonymous) {
loadLicense();
}
});
$scope.showEditor = function($event) { $scope.showEditor = function($event) {
$event.preventDefault(); $event.preventDefault();

View file

@ -52,6 +52,7 @@ from endpoints.api.superuser import (SuperUserLogs, SuperUserList, SuperUserMana
SuperUserAggregateLogs, SuperUserServiceKeyManagement, SuperUserAggregateLogs, SuperUserServiceKeyManagement,
SuperUserServiceKey, SuperUserServiceKeyApproval, SuperUserServiceKey, SuperUserServiceKeyApproval,
SuperUserTakeOwnership, SuperUserMessages, SuperUserLicense) SuperUserTakeOwnership, SuperUserMessages, SuperUserLicense)
from endpoints.api.globalmessages import GlobalUserMessage, GlobalUserMessages
from endpoints.api.secscan import RepositoryImageSecurity from endpoints.api.secscan import RepositoryImageSecurity
from endpoints.api.manifest import RepositoryManifestLabels, ManageRepositoryManifestLabel from endpoints.api.manifest import RepositoryManifestLabels, ManageRepositoryManifestLabel