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

Unified Diff: remoting/webapp/crd/js/remoting.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/oauth2.js ('k') | remoting/webapp/js_proto/dom_proto.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/remoting.js
diff --git a/remoting/webapp/crd/js/remoting.js b/remoting/webapp/crd/js/remoting.js
index df203f1252e21b51745b7457f4140b33f2cefcab..d86e6ec31f2f5120d0bc1d9a395afef7e04d6537 100644
--- a/remoting/webapp/crd/js/remoting.js
+++ b/remoting/webapp/crd/js/remoting.js
@@ -109,10 +109,11 @@ remoting.promptClose = function() {
* Also clear all local storage, to avoid leaking information.
*/
remoting.signOut = function() {
- remoting.oauth2.clear();
- chrome.storage.local.clear();
- remoting.setMode(remoting.AppMode.HOME);
- document.getElementById('auth-dialog').hidden = false;
+ remoting.oauth2.removeCachedAuthToken(function(){
+ chrome.storage.local.clear();
+ remoting.setMode(remoting.AppMode.HOME);
+ window.location.reload();
+ });
};
/**
@@ -193,9 +194,13 @@ remoting.showErrorMessage = function(error) {
document.getElementById('token-refresh-error-message'),
error);
var auth_failed = (error == remoting.Error.AUTHENTICATION_FAILED);
- document.getElementById('token-refresh-auth-failed').hidden = !auth_failed;
- document.getElementById('token-refresh-other-error').hidden = auth_failed;
- remoting.setMode(remoting.AppMode.TOKEN_REFRESH_FAILED);
+ if (base.isAppsV2()) {
+ remoting.handleAuthFailureAndRelaunch();
+ } else {
+ document.getElementById('token-refresh-auth-failed').hidden = !auth_failed;
+ document.getElementById('token-refresh-other-error').hidden = auth_failed;
+ remoting.setMode(remoting.AppMode.TOKEN_REFRESH_FAILED);
+ }
};
/**
« no previous file with comments | « remoting/webapp/crd/js/oauth2.js ('k') | remoting/webapp/js_proto/dom_proto.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698