mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-16 01:21:48 +01:00
fix: totp autofill fill single digits if one field per digit exist (#11630)
This commit is contained in:
parent
18f7d64a6d
commit
690e175b1d
@ -940,13 +940,16 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||||||
|
|
||||||
if (options.allowTotpAutofill) {
|
if (options.allowTotpAutofill) {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
totps.map(async (t) => {
|
totps.map(async (t, i) => {
|
||||||
if (Object.prototype.hasOwnProperty.call(filledFields, t.opid)) {
|
if (Object.prototype.hasOwnProperty.call(filledFields, t.opid)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
filledFields[t.opid] = t;
|
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);
|
AutofillService.fillByOpid(fillScript, t, totpValue);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user