21 lines
994 B
TypeScript
21 lines
994 B
TypeScript
import type { TextFieldClientComponent } from 'payload';
|
|
/**
|
|
* Masked text input for sensitive values (SMTP password, R2 secret key,
|
|
* Turnstile secret key, etc.).
|
|
*
|
|
* Renders the value as a password field (••••) so secrets aren't shown in
|
|
* plaintext on screen — protecting against shoulder-surfing and accidental
|
|
* exposure when the panel is open. The value is still stored and returned
|
|
* normally (UI masking, NOT hashing or encryption), because the plugin must
|
|
* read it back to authenticate with SMTP/R2/Turnstile. A toggle reveals the
|
|
* value when an authorised editor genuinely needs to check it.
|
|
*
|
|
* Uses a raw <input> driven by useField rather than @payloadcms/ui's TextInput,
|
|
* because TextInput doesn't expose inputProps, so there's no way to switch its
|
|
* inner input to type="password".
|
|
*
|
|
* Assigned via a field's admin.components.Field. Works on any `text` field.
|
|
*/
|
|
export declare const MaskedField: TextFieldClientComponent;
|
|
export default MaskedField;
|