Skip to content

Commit

Permalink
Add more secret string fields (#10149)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Oct 4, 2021
1 parent 13fe629 commit 784e5e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/ha-form/ha-form-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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`
<paper-input
.type=${this._unmaskedPassword ? "text" : "password"}
Expand Down

0 comments on commit 784e5e6

Please sign in to comment.