mirror of
https://github.com/bitwarden/clients.git
synced 2026-07-21 21:17:06 +08:00
[PM-38992] Fix Targeting Rules autofilling new password inputs with current password values (#21238)
* fix Targeting Rules autofilling new password inputs with current password values * fix Targeting Rules not being used for explicitly defined new password field inline menu typing
This commit is contained in:
parent
0d0fed94b3
commit
25bec0e5b3
@ -3,6 +3,7 @@ import "lit/polyfill-support.js";
|
||||
import { FocusableElement, tabbable } from "tabbable";
|
||||
|
||||
import {
|
||||
AutofillTargetingRuleTypes,
|
||||
AUTOFILL_OVERLAY_HANDLE_REPOSITION,
|
||||
AUTOFILL_OVERLAY_HANDLE_SCROLL,
|
||||
AUTOFILL_TRIGGER_FORM_FIELD_SUBMIT,
|
||||
@ -1177,6 +1178,11 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
||||
// which are distinct from the heuristic AutofillFieldQualifierType values.
|
||||
const qualifier = autofillFieldData.fieldQualifier as AutofillTargetingRuleType;
|
||||
|
||||
if (qualifier === AutofillTargetingRuleTypes.newPassword) {
|
||||
autofillFieldData.inlineMenuFillType = InlineMenuFillTypes.PasswordGeneration;
|
||||
return;
|
||||
}
|
||||
|
||||
if (loginQualifiers.includes(qualifier)) {
|
||||
autofillFieldData.inlineMenuFillType = CipherType.Login;
|
||||
return;
|
||||
|
||||
@ -921,12 +921,12 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||
if (fieldType === AutofillTargetingRuleTypes.username) {
|
||||
return cipher.login?.username ?? null;
|
||||
}
|
||||
if (
|
||||
fieldType === AutofillTargetingRuleTypes.password ||
|
||||
fieldType === AutofillTargetingRuleTypes.newPassword
|
||||
) {
|
||||
if (fieldType === AutofillTargetingRuleTypes.password) {
|
||||
return cipher.login?.password ?? null;
|
||||
}
|
||||
if (fieldType === AutofillTargetingRuleTypes.newPassword) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Card fields
|
||||
if (fieldType === AutofillTargetingRuleTypes.cardholderName) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user