mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-18 05:51:47 -05:00
Wrapping timer init in promise
to ensure that timer is started before initializing websockets. This was leading to instances where the websocket thought that the session hadn't been started yet. Also fixed an issue where the session wasn't tearing down the $interval when AUTH_TOKEN_PER_USER had been exceeded.
This commit is contained in:
@@ -165,9 +165,12 @@ export default ['$log', '$cookieStore', '$compile', '$window', '$rootScope', '$l
|
||||
Authorization.getUser()
|
||||
.success(function (data) {
|
||||
Authorization.setUserInfo(data);
|
||||
$rootScope.sessionTimer = Timer.init();
|
||||
$rootScope.user_is_superuser = data.results[0].is_superuser;
|
||||
scope.$emit('AuthorizationGetLicense');
|
||||
Timer.init().then(function(timer){
|
||||
$rootScope.sessionTimer = timer;
|
||||
$rootScope.$emit('OpenSocket');
|
||||
$rootScope.user_is_superuser = data.results[0].is_superuser;
|
||||
scope.$emit('AuthorizationGetLicense');
|
||||
});
|
||||
})
|
||||
.error(function (data, status) {
|
||||
Authorization.logout();
|
||||
|
||||
Reference in New Issue
Block a user