Index: remoting/webapp/crd/js/host_list_api_impl.js |
diff --git a/remoting/webapp/crd/js/host_list_api_impl.js b/remoting/webapp/crd/js/host_list_api_impl.js |
index 542e3f0e9d68e3f9ef8cd10101963cd644d444d2..5463d61ef01dba7867b3fb8481f2b5fb577487c5 100644 |
--- a/remoting/webapp/crd/js/host_list_api_impl.js |
+++ b/remoting/webapp/crd/js/host_list_api_impl.js |
@@ -41,12 +41,10 @@ remoting.HostListApiImpl.prototype.register = function( |
useIdentity: true |
}).start().then(function(response) { |
if (response.status == 200) { |
- var result = response.getJson(); |
- if (result['data']) { |
- return base.getStringAttr(result['data'], 'authorizationCode', ''); |
- } else { |
- return ''; |
- } |
+ var result = /** @type {!Object} */ (response.getJson()); |
+ var data = base.getObjectAttr(result, 'data'); |
+ var authCode = base.getStringAttr(data, 'authorizationCode'); |
+ return { authCode: authCode, email: '' }; |
} else { |
console.log( |
'Failed to register the host. Status: ' + response.status + |