From 784e5e6e39123c5fca69ab39ff3559726a4d7cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Mon, 4 Oct 2021 17:42:18 +0200 Subject: [PATCH] Add more secret string fields (#10149) --- src/components/ha-form/ha-form-string.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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`