Index: remoting/webapp/wcs.js |
diff --git a/remoting/webapp/wcs.js b/remoting/webapp/wcs.js |
index e2bb9d7f8284cfba76760857d22311a0a1e9b841..25fbbe05884b8bca2f575f2efc66b66c1a3e8330 100644 |
--- a/remoting/webapp/wcs.js |
+++ b/remoting/webapp/wcs.js |
@@ -61,9 +61,14 @@ remoting.Wcs = function(wcsIqClient, token, onReady) { |
*/ |
this.pollForUpdatedToken_ = setInterval( |
function() { |
- /** @param {string} token */ |
+ /** @param {string?} token */ |
var updateAccessToken = function(token) { |
- that.updateAccessToken_(token); |
+ if (token) { |
+ that.updateAccessToken_(token); |
+ } else { |
+ console.error('pollForUpdatedToken: Authentication failed.'); |
+ // No need to update the token. The hanging GET will fail anyway. |
+ } |
} |
remoting.oauth2.callWithToken(updateAccessToken); |
}, |