Websocket would connect before login

The websockets would make a connection before login when the user refreshes the login page. I believe this was happening on upgrade too.
This commit is contained in:
Jared Tabor 2015-01-30 16:01:22 -05:00
parent 90c8f18f76
commit 208e08410f
2 changed files with 5 additions and 1 deletions

View File

@ -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();

View File

@ -141,7 +141,6 @@ angular.module('AuthService', ['ngCookies', 'Utilities'])
restoreUserInfo: function () {
$rootScope.current_user = $cookieStore.get('current_user');
// $rootScope.$emit('OpenSocket');
},
getUserInfo: function (key) {