vault/ui/app/components/auth/fields.ts
claire bontempo ba3f7363ae
PR: Set autocomplete="off" for new auth fields (#30444)
* set autocomplete to off

* add comment

* update test
2025-04-29 12:36:48 -07:00

22 lines
567 B
TypeScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import Component from '@glimmer/component';
interface Args {
loginFields: Field[];
}
interface Field {
name: string; // sets input name
label?: string; // label will be "name" capitalized unless label exists
helperText?: string;
}
export default class AuthFields extends Component<Args> {
// token or password should render as "password" types, otherwise render text inputs
setInputType = (field: string) => (['token', 'password'].includes(field) ? 'password' : 'text');
}