Chromium Code Reviews| Index: remoting/webapp/base/js/credentials_provider.js |
| diff --git a/remoting/webapp/base/js/credentials_provider.js b/remoting/webapp/base/js/credentials_provider.js |
| index 7818f816b69eb00fe65dde8a026b463a30331426..01959912e314d357b6a8273a46cdf162691041ea 100644 |
| --- a/remoting/webapp/base/js/credentials_provider.js |
| +++ b/remoting/webapp/base/js/credentials_provider.js |
| @@ -50,16 +50,23 @@ remoting.CredentialsProvider = function(args) { |
| this.accessCode_ = args.accessCode; |
| /** @private */ |
| this.fetchThirdPartyToken_ = args.fetchThirdPartyToken; |
| + |
| + /** @private {?remoting.ChromotingEvent.AuthMethod} */ |
| + this.authMethod_ = null; |
| }; |
| /** @returns {void} */ |
| remoting.CredentialsProvider.prototype.getAccessCode_ = function( |
| /** boolean */ supportsPairing, /** Function */ callback) { |
| + this.authMethod_ = remoting.ChromotingEvent.AuthMethod.ACCESS_CODE; |
|
Jamie
2015/10/08 22:22:42
This isn't the right place to set this. Aside from
kelvinp
2015/10/09 00:45:41
I agree that the correct long term fix will be in
Jamie
2015/10/09 01:17:21
Agreed, thanks for investigating.
kelvinp
2015/10/09 18:00:34
Done.
|
| callback(this.accessCode_); |
| }; |
| /** @returns {remoting.PairingInfo} */ |
| remoting.CredentialsProvider.prototype.getPairingInfo = function() { |
| + if (this.pairingInfo_) { |
| + this.authMethod_ = remoting.ChromotingEvent.AuthMethod.PINLESS; |
| + } |
| return this.pairingInfo_ || { clientId: '', sharedSecret: ''}; |
| }; |
| @@ -72,6 +79,8 @@ remoting.CredentialsProvider.prototype.getPIN = function(pairingSupported) { |
| if (!this.fetchPin_) { |
| Promise.resolve(''); |
| } |
| + |
| + this.authMethod_ = remoting.ChromotingEvent.AuthMethod.PIN; |
| return new Promise(function(/** function(string) */ resolve) { |
| that.fetchPin_(pairingSupported, resolve); |
| }); |
| @@ -90,6 +99,8 @@ remoting.CredentialsProvider.prototype.getThirdPartyToken = function( |
| if (!this.fetchThirdPartyToken_) { |
| Promise.resolve({token: '', secret: ''}); |
| } |
| + |
| + this.authMethod_ = remoting.ChromotingEvent.AuthMethod.THIRD_PARTY; |
| return new Promise(function(/** Function */ resolve) { |
| var onTokenFetched = function(/** string */ token, /** string */ secret) { |
| resolve({token: token, secret: secret}); |
| @@ -97,3 +108,8 @@ remoting.CredentialsProvider.prototype.getThirdPartyToken = function( |
| that.fetchThirdPartyToken_(tokenUrl, hostPublicKey, scope, onTokenFetched); |
| }); |
| }; |
| + |
| +/** @return {?remoting.ChromotingEvent.AuthMethod} */ |
| +remoting.CredentialsProvider.prototype.getAuthMethod = function() { |
| + return this.authMethod_; |
| +}; |