| Index: remoting/webapp/crd/js/oauth2_api_impl.js
|
| diff --git a/remoting/webapp/crd/js/oauth2_api.js b/remoting/webapp/crd/js/oauth2_api_impl.js
|
| similarity index 91%
|
| copy from remoting/webapp/crd/js/oauth2_api.js
|
| copy to remoting/webapp/crd/js/oauth2_api_impl.js
|
| index 2bc55f5391d18b5a52eb21c24e726e2c00790510..cf976e0293380cef0056eed2185069564f769a78 100644
|
| --- a/remoting/webapp/crd/js/oauth2_api.js
|
| +++ b/remoting/webapp/crd/js/oauth2_api_impl.js
|
| @@ -12,21 +12,24 @@
|
| /** @suppress {duplicate} */
|
| var remoting = remoting || {};
|
|
|
| -/** @constructor */
|
| -remoting.OAuth2Api = function() {
|
| +/**
|
| + * @constructor
|
| + * @implements {remoting.OAuth2Api}
|
| + */
|
| +remoting.OAuth2ApiImpl = function() {
|
| };
|
|
|
| /** @private
|
| * @return {string} OAuth2 token URL.
|
| */
|
| -remoting.OAuth2Api.prototype.getOAuth2TokenEndpoint_ = function() {
|
| +remoting.OAuth2ApiImpl.prototype.getOAuth2TokenEndpoint_ = function() {
|
| return remoting.settings.OAUTH2_BASE_URL + '/token';
|
| };
|
|
|
| /** @private
|
| * @return {string} OAuth2 userinfo API URL.
|
| */
|
| -remoting.OAuth2Api.prototype.getOAuth2ApiUserInfoEndpoint_ = function() {
|
| +remoting.OAuth2ApiImpl.prototype.getOAuth2ApiUserInfoEndpoint_ = function() {
|
| return remoting.settings.OAUTH2_API_BASE_URL + '/v1/userinfo';
|
| };
|
|
|
| @@ -38,7 +41,7 @@ remoting.OAuth2Api.prototype.getOAuth2ApiUserInfoEndpoint_ = function() {
|
| * @param {number} xhrStatus Status (HTTP response code) of the XMLHttpRequest.
|
| * @return {remoting.Error} An error code to be raised.
|
| */
|
| -remoting.OAuth2Api.prototype.interpretXhrStatus_ =
|
| +remoting.OAuth2ApiImpl.prototype.interpretXhrStatus_ =
|
| function(xhrStatus) {
|
| // Return AUTHENTICATION_FAILED by default, so that the user can try to
|
| // recover from an unexpected failure by signing in again.
|
| @@ -68,7 +71,7 @@ remoting.OAuth2Api.prototype.interpretXhrStatus_ =
|
| * @param {string} refreshToken OAuth2 refresh token to be redeemed.
|
| * @return {void} Nothing.
|
| */
|
| -remoting.OAuth2Api.prototype.refreshAccessToken = function(
|
| +remoting.OAuth2ApiImpl.prototype.refreshAccessToken = function(
|
| onDone, onError, clientId, clientSecret, refreshToken) {
|
| /** @param {XMLHttpRequest} xhr */
|
| var onResponse = function(xhr) {
|
| @@ -115,7 +118,7 @@ remoting.OAuth2Api.prototype.refreshAccessToken = function(
|
| * @param {string} redirectUri Redirect URI used to obtain this code.
|
| * @return {void} Nothing.
|
| */
|
| -remoting.OAuth2Api.prototype.exchangeCodeForTokens = function(
|
| +remoting.OAuth2ApiImpl.prototype.exchangeCodeForTokens = function(
|
| onDone, onError, clientId, clientSecret, code, redirectUri) {
|
| /** @param {XMLHttpRequest} xhr */
|
| var onResponse = function(xhr) {
|
| @@ -159,7 +162,7 @@ remoting.OAuth2Api.prototype.exchangeCodeForTokens = function(
|
| * @param {string} token Access token.
|
| * @return {void} Nothing.
|
| */
|
| -remoting.OAuth2Api.prototype.getEmail = function(onDone, onError, token) {
|
| +remoting.OAuth2ApiImpl.prototype.getEmail = function(onDone, onError, token) {
|
| /** @param {XMLHttpRequest} xhr */
|
| var onResponse = function(xhr) {
|
| if (xhr.status == 200) {
|
| @@ -192,7 +195,8 @@ remoting.OAuth2Api.prototype.getEmail = function(onDone, onError, token) {
|
| * @param {string} token Access token.
|
| * @return {void} Nothing.
|
| */
|
| -remoting.OAuth2Api.prototype.getUserInfo = function(onDone, onError, token) {
|
| +remoting.OAuth2ApiImpl.prototype.getUserInfo =
|
| + function(onDone, onError, token) {
|
| /** @param {XMLHttpRequest} xhr */
|
| var onResponse = function(xhr) {
|
| if (xhr.status == 200) {
|
| @@ -216,4 +220,4 @@ remoting.OAuth2Api.prototype.getUserInfo = function(onDone, onError, token) {
|
| };
|
|
|
| /** @type {remoting.OAuth2Api} */
|
| -remoting.oauth2Api = new remoting.OAuth2Api();
|
| +remoting.oauth2Api = new remoting.OAuth2ApiImpl();
|
|
|