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',
scope: {
},
controller: function($scope, $element, ApiService) {
controller: function($scope, $element, ApiService, UserService) {
$scope.state = 'loading-license';
$scope.showingEditor = false;
$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) {
$event.preventDefault();

View file

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