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 authored Oct 30, 2024
1 parent 18f7d64 commit 690e175
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 @@ -940,13 +940,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);
}
AutofillService.fillByOpid(fillScript, t, totpValue);
}),
);
Expand Down

0 comments on commit 690e175

Please sign in to comment.