1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 14:23:32 +00:00

fix: totp autofill fill single digits if one field per digit exist (#11630)

This commit is contained in:
Florian Lang
2024-10-30 20:09:33 +01:00
committed by GitHub
parent 18f7d64a6d
commit 690e175b1d

View File

@@ -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);
}),
);