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

Side by Side Diff: remoting/webapp/crd/js/it2me_helpee_channel.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, 10 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 unified diff | Download patch
« no previous file with comments | « remoting/webapp/crd/js/identity.js ('k') | remoting/webapp/crd/js/oauth2.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 7 *
8 * It2MeHelpeeChannel relays messages between the Hangouts web page (Hangouts) 8 * It2MeHelpeeChannel relays messages between the Hangouts web page (Hangouts)
9 * and the It2Me Native Messaging Host (It2MeHost) for the helpee (the Hangouts 9 * and the It2Me Native Messaging Host (It2MeHost) for the helpee (the Hangouts
10 * participant who is receiving remoting assistance). 10 * participant who is receiving remoting assistance).
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 var onAuthenticated = function() { 395 var onAuthenticated = function() {
396 oauth2.callWithToken( 396 oauth2.callWithToken(
397 resolve, 397 resolve,
398 function() { throw new Error('Authentication failed.'); }); 398 function() { throw new Error('Authentication failed.'); });
399 }; 399 };
400 /** @param {remoting.Error} error */ 400 /** @param {remoting.Error} error */
401 var onError = function(error) { 401 var onError = function(error) {
402 if (error != remoting.Error.NOT_AUTHENTICATED) { 402 if (error != remoting.Error.NOT_AUTHENTICATED) {
403 throw new Error('Unexpected error fetch auth token: ' + error); 403 throw new Error('Unexpected error fetch auth token: ' + error);
404 } 404 }
405 oauth2.doAuthRedirect(onAuthenticated); 405 oauth2.removeCachedAuthToken();
406 }; 406 };
407 oauth2.callWithToken(resolve, onError); 407 oauth2.callWithToken(resolve, onError);
408 }); 408 });
409 } 409 }
410 }; 410 };
411 411
412 /** 412 /**
413 * Connects to the It2Me Native Messaging Host and retrieves the access code 413 * Connects to the It2Me Native Messaging Host and retrieves the access code
414 * in the |onHostStateChanged_| callback. 414 * in the |onHostStateChanged_| callback.
415 * 415 *
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 488
489 console.error('Error responding to message method:' + 489 console.error('Error responding to message method:' +
490 (incomingMessage ? incomingMessage.method : 'null') + 490 (incomingMessage ? incomingMessage.method : 'null') +
491 ' error:' + error); 491 ' error:' + error);
492 this.hangoutPort_.postMessage({ 492 this.hangoutPort_.postMessage({
493 method: remoting.It2MeHelpeeChannel.HangoutMessageTypes.ERROR, 493 method: remoting.It2MeHelpeeChannel.HangoutMessageTypes.ERROR,
494 message: error, 494 message: error,
495 request: incomingMessage 495 request: incomingMessage
496 }); 496 });
497 }; 497 };
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/identity.js ('k') | remoting/webapp/crd/js/oauth2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698