1
0
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:
Jeffrey Holland
2025-09-29 16:20:47 +02:00
parent adbf80dd39
commit 55ad6ae171
2 changed files with 10 additions and 1 deletions

View File

@@ -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",

View File

@@ -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;