Index: remoting/webapp/client_screen.js |
diff --git a/remoting/webapp/client_screen.js b/remoting/webapp/client_screen.js |
index 8be30fbefb50c173907353ca237ba07a8ccb2c3c..2f066e7fc29913f60948c465eb0b51b0473d9f59 100644 |
--- a/remoting/webapp/client_screen.js |
+++ b/remoting/webapp/client_screen.js |
@@ -314,11 +314,15 @@ function startSession_() { |
/** @type {string} */ (remoting.oauth2.getCachedEmail()), |
remoting.ClientSession.Mode.IT2ME, |
onClientStateChange_); |
- /** @param {string} token The auth token. */ |
+ /** @param {string?} token The auth token. */ |
var createPluginAndConnect = function(token) { |
- remoting.clientSession.createPluginAndConnect( |
- document.getElementById('session-mode'), |
- token); |
+ if (token) { |
+ remoting.clientSession.createPluginAndConnect( |
+ document.getElementById('session-mode'), |
+ token); |
+ } else { |
+ showConnectError_(remoting.Error.AUTHENTICATION_FAILED); |
+ } |
}; |
remoting.oauth2.callWithToken(createPluginAndConnect); |
} |