GUAC-1126: Maintain session-local data through login/logout events broadcast from the authentication service.

This commit is contained in:
Michael Jumper
2015-04-09 13:01:37 -07:00
parent 311d56bae5
commit c69f7db522
6 changed files with 49 additions and 22 deletions

View File

@@ -28,7 +28,7 @@ angular.module('rest').factory('cacheService', ['$injector',
// Required services
var $cacheFactory = $injector.get('$cacheFactory');
var $rootScope = $injector.get('$rootScope');
// Service containing all caches
var service = {};
@@ -63,7 +63,12 @@ angular.module('rest').factory('cacheService', ['$injector',
service.connections.removeAll();
service.users.removeAll();
};
// Clear caches on logout
$rootScope.$on('guacLogout', function handleLogout() {
service.clearCaches();
});
return service;
}]);