Return 403 if the user logged in is now an org and handle it on the client

This commit is contained in:
Joseph Schorr 2013-11-11 19:03:18 -05:00
parent 743e95c50e
commit 07b9128ab6
2 changed files with 13 additions and 4 deletions

View file

@ -867,7 +867,14 @@ quayApp.directive('ngBlur', function() {
};
});
quayApp.run(['$location', '$rootScope', function($location, $rootScope) {
quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', function($location, $rootScope, Restangular, UserService) {
Restangular.setResponseInterceptor(function(data, operation, what, url, response, deferred) {
if (response.status == 403) {
UserService.load();
}
return data;
});
$rootScope.$on('$routeChangeSuccess', function (event, current, previous) {
if (current.$$route.title) {
$rootScope.title = current.$$route.title;