Chromium Code Reviews| 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..849b930928d9e25c08a3147bc062debab132d306 100644 |
| --- a/remoting/webapp/crd/js/crd_event_handlers.js |
| +++ b/remoting/webapp/crd/js/crd_event_handlers.js |
| @@ -19,7 +19,8 @@ remoting.initElementEventHandlers = function() { |
| then(function(token) { |
| remoting.setMode(remoting.AppMode.CLIENT_UNCONNECTED); |
| }). |
| - catch(remoting.Error.handler(remoting.showErrorMessage)); |
| + catch(remoting.Error.handler( |
| + remoting.app.onAuthError.bind(remoting.app))); |
| }; |
| var goFinishedIT2Me = function() { |
| if (remoting.currentMode == remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME) { |
| @@ -84,3 +85,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() { |
|
garykac
2015/03/19 01:03:43
moved here from remoting.js. It is only used in th
kelvinp
2015/03/19 17:50:20
Acknowledged.
|
| + remoting.oauth2.removeCachedAuthToken().then(function(){ |
| + chrome.storage.local.clear(); |
| + remoting.setMode(remoting.AppMode.HOME); |
| + window.location.reload(); |
| + }); |
| +}; |
| + |