diff --git a/remoting/webapp/crd/js/oauth2.js b/remoting/webapp/crd/js/oauth2.js index ae4d3c0e93c2..fb5eca33558a 100644 --- a/remoting/webapp/crd/js/oauth2.js +++ b/remoting/webapp/crd/js/oauth2.js @@ -51,7 +51,7 @@ remoting.OAuth2.prototype.SCOPE_ = * @return {string} OAuth2 redirect URI. */ remoting.OAuth2.prototype.getRedirectUri_ = function() { - return remoting.settings.OAUTH2_REDIRECT_URL; + return remoting.settings.OAUTH2_REDIRECT_URL(); }; /** @private diff --git a/remoting/webapp/crd/js/plugin_settings.js b/remoting/webapp/crd/js/plugin_settings.js index 44294d236121..ab2c3061979e 100644 --- a/remoting/webapp/crd/js/plugin_settings.js +++ b/remoting/webapp/crd/js/plugin_settings.js @@ -32,8 +32,16 @@ remoting.Settings.prototype.OAUTH2_API_BASE_URL = 'OAUTH2_API_BASE_URL'; remoting.Settings.prototype.DIRECTORY_API_BASE_URL = 'DIRECTORY_API_BASE_URL'; /** @type {string} URL for the talk gadget web service. */ remoting.Settings.prototype.TALK_GADGET_URL = 'TALK_GADGET_URL'; -/** @type {string} OAuth2 redirect URI. */ -remoting.Settings.prototype.OAUTH2_REDIRECT_URL = 'OAUTH2_REDIRECT_URL'; + +/** + * @return {string} OAuth2 redirect URI. Note that this needs to be a function + * because it gets expanded at compile-time to an expression that involves + * a chrome API. Since this file is loaded into the WCS sandbox, which has + * no access to these APIs, we can't call it at global scope. + */ +remoting.Settings.prototype.OAUTH2_REDIRECT_URL = function() { + return 'OAUTH2_REDIRECT_URL'; +} /** @type {string} XMPP JID for the remoting directory server bot. */ remoting.Settings.prototype.DIRECTORY_BOT_JID = 'DIRECTORY_BOT_JID';