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

Unified Diff: remoting/webapp/crd/js/oauth2.js

Issue 868203002: Handle authentication failures in the v2 app by restarting the app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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 | « remoting/webapp/crd/js/it2me_helpee_channel.js ('k') | remoting/webapp/crd/js/remoting.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/oauth2.js
diff --git a/remoting/webapp/crd/js/oauth2.js b/remoting/webapp/crd/js/oauth2.js
index 52e12f8841480cf92bb92a8b2d7e274289e2e1cd..7a18a9c996559ca04fba2275ae04a1f43e2ac0a8 100644
--- a/remoting/webapp/crd/js/oauth2.js
+++ b/remoting/webapp/crd/js/oauth2.js
@@ -82,15 +82,19 @@ remoting.OAuth2.prototype.isAuthenticated = function() {
};
/**
- * Removes all storage, and effectively unauthenticates the user.
+ * Remove the cached auth token, if any.
*
+ * @param {function():void=} opt_onDone Completion callback.
* @return {void} Nothing.
*/
-remoting.OAuth2.prototype.clear = function() {
+remoting.OAuth2.prototype.removeCachedAuthToken = function(opt_onDone) {
window.localStorage.removeItem(this.KEY_EMAIL_);
window.localStorage.removeItem(this.KEY_FULLNAME_);
this.clearAccessToken_();
this.clearRefreshToken_();
+ if (opt_onDone) {
+ opt_onDone();
+ }
};
/**
« no previous file with comments | « remoting/webapp/crd/js/it2me_helpee_channel.js ('k') | remoting/webapp/crd/js/remoting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698