diff --git a/src/components/ha-form/ha-form-string.ts b/src/components/ha-form/ha-form-string.ts index 82e4520bfa..98c4d13c30 100644 --- a/src/components/ha-form/ha-form-string.ts +++ b/src/components/ha-form/ha-form-string.ts @@ -12,6 +12,8 @@ import type { HaFormStringSchema, } from "./ha-form"; +const MASKED_FIELDS = ["password", "secret", "token"]; + @customElement("ha-form-string") export class HaFormString extends LitElement implements HaFormElement { @property() public schema!: HaFormStringSchema; @@ -33,7 +35,7 @@ export class HaFormString extends LitElement implements HaFormElement { } protected render(): TemplateResult { - return this.schema.name.includes("password") + return MASKED_FIELDS.some((field) => this.schema.name.includes(field)) ? html`