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 2f754397b1cba7c52fb122fa8accfcfbf1551f62..c31bbfcd70413f4ac316850e0246940b4ddb707a 100644 |
| --- a/remoting/webapp/crd/js/crd_event_handlers.js |
| +++ b/remoting/webapp/crd/js/crd_event_handlers.js |
| @@ -38,26 +38,8 @@ remoting.initElementEventHandlers = function() { |
| remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); |
| remoting.app.getSessionConnector().reconnect(); |
| }; |
| - var doAuthRedirect = function() { |
| - if (!base.isAppsV2()) { |
| - remoting.oauth2.doAuthRedirect(function() { |
| - window.location.reload(); |
| - }); |
| - } |
| - }; |
| - var fixAuthError = function() { |
| - if (base.isAppsV2()) { |
| - var onRefresh = function() { |
| - remoting.hostList.display(); |
| - }; |
| - var refreshHostList = function() { |
| - goHome(); |
| - remoting.hostList.refresh(onRefresh); |
| - }; |
| - remoting.identity.removeCachedAuthToken(refreshHostList); |
| - } else { |
| - doAuthRedirect(); |
| - } |
| + var handleAuthFailure = function() { |
| + remoting.identity.handleAuthFailureAndRelaunch(); |
| }; |
| /** @param {Event} event The event. */ |
| var stopDaemon = function(event) { |
| @@ -105,11 +87,12 @@ remoting.initElementEventHandlers = function() { |
| ]; |
| /** @type {Array.<{event: string, id: string, fn: function(Event):void}>} */ |
| var auth_actions = [ |
| - { event: 'click', id: 'auth-button', fn: doAuthRedirect }, |
| + { event: 'click', id: 'auth-button', fn: handleAuthFailure }, |
|
Jamie
2015/01/23 23:33:26
I'm not sure this will work. I think "auth-button"
kelvinp
2015/01/28 00:26:45
Done.
|
| { event: 'click', id: 'cancel-connect-button', fn: goHome }, |
| { event: 'click', id: 'sign-out', fn:remoting.signOut }, |
| { event: 'click', id: 'token-refresh-error-ok', fn: goHome }, |
| - { event: 'click', id: 'token-refresh-error-sign-in', fn: fixAuthError } |
| + { event: 'click', id: 'token-refresh-error-sign-in', |
| + fn: handleAuthFailure } |
| ]; |
| registerEventListeners(it2me_actions); |
| registerEventListeners(me2me_actions); |