Merge branch 'autofill/pm-12775-fix-bitwarden-autofilling-two-factor-in-web-app' into autofill/pm-8833-implement-on-page-autofill-menu-for-password-generation
This commit is contained in:
commit
8ee5aabb0b
|
@ -35,10 +35,8 @@ export class AutoFillConstants {
|
|||
"2facode",
|
||||
"approvals_code",
|
||||
"mfacode",
|
||||
"otc",
|
||||
"otc-code",
|
||||
"onetimecode",
|
||||
"otp",
|
||||
"otp-code",
|
||||
"otpcode",
|
||||
"onetimepassword",
|
||||
|
@ -49,6 +47,14 @@ export class AutoFillConstants {
|
|||
"verification code",
|
||||
];
|
||||
|
||||
static readonly AmbiguousTotpFieldNames: string[] = [
|
||||
"code",
|
||||
"pin",
|
||||
"otc",
|
||||
"otp",
|
||||
...AutoFillConstants.TotpFieldNames,
|
||||
];
|
||||
|
||||
static readonly SearchFieldNames: string[] = ["search", "query", "find", "go"];
|
||||
|
||||
static readonly FieldIgnoreList: string[] = ["captcha", "findanything", "forgot"];
|
||||
|
|
|
@ -887,7 +887,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||
options.allowTotpAutofill &&
|
||||
f.viewable &&
|
||||
(f.type === "text" || f.type === "number") &&
|
||||
(AutofillService.fieldIsFuzzyMatch(f, AutoFillConstants.TotpFieldNames) ||
|
||||
(AutofillService.fieldIsFuzzyMatch(f, AutoFillConstants.AmbiguousTotpFieldNames) ||
|
||||
f.autoCompleteType === "one-time-code")
|
||||
) {
|
||||
totps.push(f);
|
||||
|
@ -2678,12 +2678,12 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||
(withoutForm || f.form === passwordField.form) &&
|
||||
(canBeHidden || f.viewable) &&
|
||||
(f.type === "text" || f.type === "number") &&
|
||||
AutofillService.fieldIsFuzzyMatch(f, AutoFillConstants.TotpFieldNames)
|
||||
AutofillService.fieldIsFuzzyMatch(f, AutoFillConstants.AmbiguousTotpFieldNames)
|
||||
) {
|
||||
totpField = f;
|
||||
|
||||
if (
|
||||
this.findMatchingFieldIndex(f, AutoFillConstants.TotpFieldNames) > -1 ||
|
||||
this.findMatchingFieldIndex(f, AutoFillConstants.AmbiguousTotpFieldNames) > -1 ||
|
||||
f.autoCompleteType === "one-time-code"
|
||||
) {
|
||||
// We found an exact match. No need to keep looking.
|
||||
|
|
Loading…
Reference in New Issue