Chromium Code Reviews| Index: remoting/webapp/crd/js/oauth2.js |
| diff --git a/remoting/webapp/crd/js/oauth2.js b/remoting/webapp/crd/js/oauth2.js |
| index c504a645d72d09208c141b94e18a59836b9a0334..9056c9727abf4b72b7a076f6bda9292a434776e6 100644 |
| --- a/remoting/webapp/crd/js/oauth2.js |
| +++ b/remoting/webapp/crd/js/oauth2.js |
| @@ -237,12 +237,13 @@ remoting.OAuth2.prototype.onTokens_ = |
| /** |
| * Redirect page to get a new OAuth2 Refresh Token. |
| * |
| + * @param {function():void} onDone Completion callback. |
| * @return {void} Nothing. |
| */ |
| -remoting.OAuth2.prototype.doAuthRedirect = function() { |
| +remoting.OAuth2.prototype.doAuthRedirect = function(onDone) { |
| /** @type {remoting.OAuth2} */ |
| var that = this; |
| - var xsrf_token = remoting.generateXsrfToken(); |
| + var xsrf_token = base.generateXsrfToken(); |
| window.localStorage.setItem(this.KEY_XSRF_TOKEN_, xsrf_token); |
| var GET_CODE_URL = this.getOAuth2AuthEndpoint_() + '?' + |
| remoting.xhr.urlencodeParamHash({ |
| @@ -263,9 +264,6 @@ remoting.OAuth2.prototype.doAuthRedirect = function() { |
| */ |
| function oauth2MessageListener(message) { |
| if ('code' in message && 'state' in message) { |
| - var onDone = function() { |
| - window.location.reload(); |
| - }; |
| that.exchangeCodeForToken( |
| message['code'], message['state'], onDone); |
|
kelvinp
2014/10/29 20:28:54
Probably need to remove onDone from line 268 as we
Jamie
2014/10/30 19:38:25
I think this is correct. We're just delegating the
kelvinp
2014/10/30 20:48:38
My bad. Face palm O_O
|
| } else { |