mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-13 15:50:59 +00:00
FS-8205 [verto_communicator] fix login config and checkConfig
This commit is contained in:
parent
f13308910c
commit
e7b50e8726
@ -101,22 +101,7 @@
|
||||
|
||||
result['promise'] = configPromise;
|
||||
|
||||
var connectCallback = function(v, connected) {
|
||||
verto.data.connecting = false;
|
||||
if (connected) {
|
||||
storage.data.ui_connected = verto.data.connected;
|
||||
storage.data.ws_connected = verto.data.connected;
|
||||
storage.data.name = verto.data.name;
|
||||
storage.data.email = verto.data.email;
|
||||
storage.data.login = verto.data.login;
|
||||
storage.data.password = verto.data.password;
|
||||
resolve(result);
|
||||
}
|
||||
};
|
||||
|
||||
verto.data.connecting = true;
|
||||
verto.connect(connectCallback);
|
||||
|
||||
resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -30,12 +30,18 @@
|
||||
console.debug('MainController: WebSocket not connected. Redirecting to login.');
|
||||
$location.path('/');
|
||||
}
|
||||
|
||||
|
||||
$rootScope.$on('config.http.success', function(ev) {
|
||||
$scope.login(false);
|
||||
});
|
||||
/**
|
||||
* Login the user to verto server and
|
||||
* redirects him to dialpad page.
|
||||
*/
|
||||
$scope.login = function() {
|
||||
$scope.login = function(redirect) {
|
||||
if(redirect == undefined) {
|
||||
redirect = true;
|
||||
}
|
||||
var connectCallback = function(v, connected) {
|
||||
$scope.$apply(function() {
|
||||
verto.data.connecting = false;
|
||||
@ -46,7 +52,9 @@
|
||||
storage.data.email = verto.data.email;
|
||||
storage.data.login = verto.data.login;
|
||||
storage.data.password = verto.data.password;
|
||||
$location.path('/dialpad');
|
||||
if (redirect) {
|
||||
$location.path('/dialpad');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -61,8 +61,10 @@ vertoService.service('config', ['$rootScope', '$http', '$location', 'storage', '
|
||||
verto.data.autologin_done = true;
|
||||
}
|
||||
|
||||
$rootScope.$emit('config.http.success', data);
|
||||
return response;
|
||||
}, function(response) {
|
||||
$rootScope.$emit('config.http.error', response);
|
||||
return response;
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user