Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Unified Diff: remoting/webapp/app_remoting/js/app_connected_view.js

Issue 1123183005: Respect opt_scopes in getNewToken. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/webapp/base/js/identity.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/app_remoting/js/app_connected_view.js
diff --git a/remoting/webapp/app_remoting/js/app_connected_view.js b/remoting/webapp/app_remoting/js/app_connected_view.js
index 73c308840c75abfff56082c91db00444f2c314d0..0ba7b577d202e99441d286204370caae2ccd1fd2 100644
--- a/remoting/webapp/app_remoting/js/app_connected_view.js
+++ b/remoting/webapp/app_remoting/js/app_connected_view.js
@@ -239,10 +239,16 @@ remoting.AppConnectedView.prototype.sendGoogleDriveAccessToken_ =
];
remoting.identity.getNewToken(googleDriveScopes).then(
function(/** string */ token){
+ base.debug.assert(token !== previousToken_);
+ previousToken_ = token;
sendExtensionMessage('accessToken', token);
}).catch(remoting.Error.handler(function(/** remoting.Error */ error) {
console.log('Failed to refresh access token: ' + error.toString());
}));
};
+// The access token last received from getNewToken. Saved to ensure that we
+// get a fresh token each time.
+var previousToken_ = '';
+
})();
« no previous file with comments | « no previous file | remoting/webapp/base/js/identity.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698