summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/host_setup_dialog.js
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/webapp/host_setup_dialog.js')
-rw-r--r--remoting/webapp/host_setup_dialog.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/remoting/webapp/host_setup_dialog.js b/remoting/webapp/host_setup_dialog.js
index fe60ecb..c0e5ae2 100644
--- a/remoting/webapp/host_setup_dialog.js
+++ b/remoting/webapp/host_setup_dialog.js
@@ -150,6 +150,18 @@ remoting.HostSetupDialog = function(hostController) {
* @return {void} Nothing.
*/
remoting.HostSetupDialog.prototype.showForStart = function() {
+ // Although we don't need an access token in order to start the host,
+ // using callWithToken here ensures consistent error handling in the
+ // case where the refresh token is invalid.
+ remoting.oauth2.callWithToken(this.showForStartWithToken_.bind(this),
+ remoting.defaultOAuthErrorHandler);
+};
+
+/**
+ * @param {string} token The OAuth2 token.
+ * @private
+ */
+remoting.HostSetupDialog.prototype.showForStartWithToken_ = function(token) {
/** @type {remoting.HostSetupDialog} */
var that = this;
@@ -423,7 +435,7 @@ remoting.HostSetupDialog.validPin_ = function(pin) {
}
}
return true;
-}
+};
/**
* @return {void} Nothing.
@@ -436,14 +448,14 @@ remoting.HostSetupDialog.prototype.onInstallDialogOk = function() {
} else {
remoting.setMode(remoting.AppMode.HOST_SETUP_INSTALL_PENDING);
}
-}
+};
/**
* @return {void} Nothing.
*/
remoting.HostSetupDialog.prototype.onInstallDialogRetry = function() {
remoting.setMode(remoting.AppMode.HOST_SETUP_INSTALL);
-}
+};
/** @type {remoting.HostSetupDialog} */
remoting.hostSetupDialog = null;