only copy totp on login types

This commit is contained in:
Kyle Spearrin 2017-10-17 21:10:44 -04:00
parent 5b6158c0b7
commit a0b953208d
2 changed files with 7 additions and 4 deletions

View File

@ -47,7 +47,8 @@ var bg_isBackground = true,
bg_cryptoService, logout);
bg_passwordGenerationService = new PasswordGenerationService(bg_constantsService, bg_utilsService, bg_cryptoService);
bg_totpService = new TotpService(bg_constantsService);
bg_autofillService = new AutofillService(bg_utilsService, bg_totpService, bg_tokenService, bg_cipherService);
bg_autofillService = new AutofillService(bg_utilsService, bg_totpService, bg_tokenService, bg_cipherService,
bg_constantsService);
if (chrome.commands) {
chrome.commands.onCommand.addListener(function (command) {

View File

@ -1,8 +1,9 @@
function AutofillService(utilsService, totpService, tokenService, cipherService) {
function AutofillService(utilsService, totpService, tokenService, cipherService, constantsService) {
this.utilsService = utilsService;
this.totpService = totpService;
this.tokenService = tokenService;
this.cipherService = cipherService;
this.cipherService = cipherService;
initAutofill();
}
@ -238,8 +239,9 @@ function initAutofill() {
fillScript: fillScript
}, { frameId: options.pageDetails[i].frameId });
if (totpPromise || (options.fromBackground && self.utilsService.isFirefox()) ||
options.skipTotp || !options.cipher.login || !options.cipher.login.totp || !self.tokenService.getPremium()) {
if (options.cipher.type !== self.constantsService.cipherType.login || totpPromise ||
(options.fromBackground && self.utilsService.isFirefox()) || options.skipTotp ||
!options.cipher.login.totp || !self.tokenService.getPremium()) {
continue;
}