Skip to content

Commit

Permalink
fix: totp autofill fill single digits if one field per digit exist
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLang06 committed Oct 19, 2024
1 parent a884fcf commit ba23fc7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/browser/src/autofill/services/autofill.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -927,13 +927,16 @@ export default class AutofillService implements AutofillServiceInterface {

if (options.allowTotpAutofill) {
await Promise.all(
totps.map(async (t) => {
totps.map(async (t, i) => {
if (Object.prototype.hasOwnProperty.call(filledFields, t.opid)) {
return;
}

filledFields[t.opid] = t;
const totpValue = await this.totpService.getCode(login.totp);
let totpValue = await this.totpService.getCode(login.totp);
if (totpValue.length == totps.length) {
totpValue = totpValue.charAt(i);

Check warning on line 938 in apps/browser/src/autofill/services/autofill.service.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/autofill/services/autofill.service.ts#L938

Added line #L938 was not covered by tests
}
AutofillService.fillByOpid(fillScript, t, totpValue);
}),
);
Expand Down

0 comments on commit ba23fc7

Please sign in to comment.