diff --git a/awx/ui/static/js/app.js b/awx/ui/static/js/app.js index a777d252c3..571741ee9c 100644 --- a/awx/ui/static/js/app.js +++ b/awx/ui/static/js/app.js @@ -631,6 +631,11 @@ angular.module('Tower', [ } else { // If browser refresh, set the user_is_superuser value $rootScope.user_is_superuser = Authorization.getUserInfo('is_superuser'); + // when the user refreshes we want to open the socket, except if the user is on the login page, which should happen after the user logs in (see the AuthService module for that call to OpenSocket) + if($location.$$url !== '/login'){ + $rootScope.$emit('OpenSocket'); + } + } activateTab(); diff --git a/awx/ui/static/lib/ansible/AuthService.js b/awx/ui/static/lib/ansible/AuthService.js index ce8b4f73b1..6e3ae7647a 100644 --- a/awx/ui/static/lib/ansible/AuthService.js +++ b/awx/ui/static/lib/ansible/AuthService.js @@ -141,7 +141,6 @@ angular.module('AuthService', ['ngCookies', 'Utilities']) restoreUserInfo: function () { $rootScope.current_user = $cookieStore.get('current_user'); - // $rootScope.$emit('OpenSocket'); }, getUserInfo: function (key) {