mirror of
https://github.com/bitwarden/browser
synced 2026-02-17 18:09:17 +00:00
Check for webauthn field and new-password field in login form
This commit is contained in:
@@ -605,7 +605,7 @@ describe("InlineMenuFieldQualificationService", () => {
|
||||
});
|
||||
|
||||
describe("a valid username field", () => {
|
||||
["username", "email"].forEach((autoCompleteType) => {
|
||||
["username", "email", "webauthn"].forEach((autoCompleteType) => {
|
||||
it(`has a ${autoCompleteType} 'autoCompleteType' value`, () => {
|
||||
const field = mock<AutofillField>({
|
||||
type: "text",
|
||||
|
||||
@@ -242,6 +242,15 @@ export class InlineMenuFieldQualificationService
|
||||
return this.isPasswordFieldForLoginForm(field, pageDetails);
|
||||
}
|
||||
|
||||
// If the field is a WebAuthn field assume it is a login field.
|
||||
if (this.fieldContainsAutocompleteValues(field, new Set([this.webAuthnAutocompleteValue]))) {
|
||||
const hasWebAuthnField = pageDetails.fields.some((f) => this.isPasswordField(f));
|
||||
|
||||
if (hasWebAuthnField) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
const isUsernameField = this.isUsernameField(field);
|
||||
if (!isUsernameField) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user