diff --git a/apps/browser/src/autofill/services/autofill.service.ts b/apps/browser/src/autofill/services/autofill.service.ts index 1ff2341d9f..696bdb8b89 100644 --- a/apps/browser/src/autofill/services/autofill.service.ts +++ b/apps/browser/src/autofill/services/autofill.service.ts @@ -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); }), );