1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +00:00

copy totp from each implementation of autofill

This commit is contained in:
Kyle Spearrin
2018-04-23 10:02:30 -04:00
parent 271f9df8ae
commit 06e56f0b57
5 changed files with 18 additions and 24 deletions

View File

@@ -136,11 +136,15 @@ export default class RuntimeBackground {
break;
case 'autofiller':
case 'autofill_cmd':
await this.autofillService.doAutoFillForLastUsedLogin([{
const totpCode = await this.autofillService.doAutoFillForLastUsedLogin([{
frameId: sender.frameId,
tab: msg.tab,
details: msg.details,
}], msg.sender === 'autofill_cmd');
if (totpCode !== null && !this.platformUtilsService.isFirefox()) {
this.platformUtilsService.copyToClipboard(totpCode);
}
break;
case 'contextMenu':
clearTimeout(this.autofillTimeout);
@@ -161,12 +165,15 @@ export default class RuntimeBackground {
}
private async autofillPage() {
await this.autofillService.doAutoFill({
const totpCode = await this.autofillService.doAutoFill({
cipher: this.main.loginToAutoFill,
pageDetails: this.pageDetailsToAutoFill,
fromBackground: true,
});
if (totpCode !== null && !this.platformUtilsService.isFirefox()) {
this.platformUtilsService.copyToClipboard(totpCode);
}
// reset
this.main.loginToAutoFill = null;
this.pageDetailsToAutoFill = [];