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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

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