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

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

Issue 1020743002: [Chromoting] Move app-specific code out of remoting.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make isMe2MeInstallable private Created 5 years, 9 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/crd/js/crd_main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/crd_event_handlers.js
diff --git a/remoting/webapp/crd/js/crd_event_handlers.js b/remoting/webapp/crd/js/crd_event_handlers.js
index fb96ee0ab3e18293aaf2f7b1dfc04b9b92eba6aa..991c36b4cfd69cb8b5c2e9ebb86cb67c95cdcbc9 100644
--- a/remoting/webapp/crd/js/crd_event_handlers.js
+++ b/remoting/webapp/crd/js/crd_event_handlers.js
@@ -84,3 +84,18 @@ remoting.initElementEventHandlers = function() {
registerEventListeners(host_actions);
registerEventListeners(auth_actions);
}
+
+/**
+ * Sign the user out of Chromoting by clearing (and revoking, if possible) the
+ * OAuth refresh token.
+ *
+ * Also clear all local storage, to avoid leaking information.
+ */
+remoting.signOut = function() {
+ remoting.oauth2.removeCachedAuthToken().then(function(){
+ chrome.storage.local.clear();
+ remoting.setMode(remoting.AppMode.HOME);
+ window.location.reload();
+ });
+};
+
« no previous file with comments | « no previous file | remoting/webapp/crd/js/crd_main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698