Commit ef55b1ae authored by Evren Kutar's avatar Evren Kutar

socket retry connection

auth data.cmd retry call /login again
parent a6dc0129
...@@ -28,6 +28,9 @@ angular.module('ulakbus.auth') ...@@ -28,6 +28,9 @@ angular.module('ulakbus.auth')
$rootScope.$broadcast("user_ready"); $rootScope.$broadcast("user_ready");
$rootScope.$broadcast("ws_turn_on"); $rootScope.$broadcast("ws_turn_on");
return $location.path('/dashboard'); return $location.path('/dashboard');
}
if (data.cmd === 'retry') {
$location.path('/login');
} else{ } else{
if (angular.isDefined(data.forms) && $location.path() !== '/login'){ if (angular.isDefined(data.forms) && $location.path() !== '/login'){
$location.path('/login'); $location.path('/login');
......
...@@ -47,10 +47,10 @@ angular.module('ulakbus') ...@@ -47,10 +47,10 @@ angular.module('ulakbus')
websocket.onclose = function (evt) { websocket.onclose = function (evt) {
wsOps.onClose(evt); wsOps.onClose(evt);
if (wsOps.loggedOut === true) {return;} if (wsOps.loggedOut === true) {return;}
// $timeout(function () { $timeout(function () {
// generate_ws(); generate_ws();
// refresh_count += 1; refresh_count += 1;
// }, refresh_websocket); }, refresh_websocket);
}; };
websocket.onmessage = function (evt) { websocket.onmessage = function (evt) {
wsOps.onMessage(evt) wsOps.onMessage(evt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment