mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 15:11:07 +02:00
22 lines
567 B
TypeScript
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');
|
|
}
|