Chromium Code Reviews| 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..b573530c27309f0abdf799047424f87e64c39599 100644 |
| --- a/remoting/webapp/crd/js/host_list_api_impl.js |
| +++ b/remoting/webapp/crd/js/host_list_api_impl.js |
| @@ -42,11 +42,9 @@ remoting.HostListApiImpl.prototype.register = function( |
| }).start().then(function(response) { |
| if (response.status == 200) { |
| var result = response.getJson(); |
| - if (result['data']) { |
| - return base.getStringAttr(result['data'], 'authorizationCode', ''); |
| - } else { |
| - return ''; |
| - } |
| + var data = base.getObjectAttr(result, 'data'); |
| + var authCode = base.getStringAttr(data, 'authorizationCode'); |
|
John Williams
2015/04/28 20:27:41
Simplified based on the assumption that the auth c
|
| + return { authCode: authCode, email: '' }; |
| } else { |
| console.log( |
| 'Failed to register the host. Status: ' + response.status + |