Index: remoting/webapp/crd/js/host_controller.js |
diff --git a/remoting/webapp/crd/js/host_controller.js b/remoting/webapp/crd/js/host_controller.js |
index 3dd8c93558c8d489aa53b8cb9fe2a97724bbc848..99959e292365a97d2beb70a34097b0e2cb912371 100644 |
--- a/remoting/webapp/crd/js/host_controller.js |
+++ b/remoting/webapp/crd/js/host_controller.js |
@@ -307,9 +307,10 @@ remoting.HostController.prototype.start = function(hostPin, consent, onDone, |
*/ |
function onHostClientId( |
hostName, privateKey, publicKey, hostClientId) { |
- remoting.identity.callWithToken( |
+ remoting.identity.getToken().then( |
doRegisterHost.bind( |
- null, hostName, privateKey, publicKey, hostClientId), onError); |
+ null, hostName, privateKey, publicKey, hostClientId), |
+ remoting.Error.handler(onError)); |
} |
/** |
@@ -324,9 +325,10 @@ remoting.HostController.prototype.start = function(hostPin, consent, onDone, |
that.hostDaemonFacade_.getHostClientId( |
onHostClientId.bind(null, hostName, privateKey, publicKey), onError); |
} else { |
- remoting.identity.callWithToken( |
+ remoting.identity.getToken().then( |
doRegisterHost.bind( |
- null, hostName, privateKey, publicKey, null), onError); |
+ null, hostName, privateKey, publicKey, null), |
+ remoting.Error.handler(onError)); |
} |
} |
@@ -559,8 +561,9 @@ remoting.HostController.prototype.getClientBaseJid_ = function( |
/** @param {string} token */ |
function connectSignalingWithToken(token) { |
- remoting.identity.getEmail( |
- connectSignalingWithTokenAndEmail.bind(null, token), onError); |
+ remoting.identity.getEmail().then( |
+ connectSignalingWithTokenAndEmail.bind(null, token), |
+ remoting.Error.handler(onError)); |
} |
/** |
@@ -572,7 +575,8 @@ remoting.HostController.prototype.getClientBaseJid_ = function( |
remoting.settings.XMPP_SERVER_FOR_CLIENT, email, token); |
} |
- remoting.identity.callWithToken(connectSignalingWithToken, onError); |
+ remoting.identity.getToken().then( |
+ connectSignalingWithToken, remoting.Error.handler(onError)); |
}; |
/** @type {remoting.HostController} */ |