fix(email): preserve newlines in PGP key textarea fields (#2617)

This commit is contained in:
fallenbagel
2026-03-02 16:33:11 +05:00
committed by GitHub
parent 3557745b62
commit 835e9176c0
2 changed files with 14 additions and 7 deletions

View File

@@ -20,7 +20,7 @@ const SensitiveInput = ({ as = 'input', ...props }: SensitiveInputProps) => {
? props
: {
...props,
as: props.type === 'textarea' && !isHidden ? 'textarea' : undefined,
as: props.type === 'textarea' ? 'textarea' : undefined,
};
return (
<>
@@ -32,11 +32,18 @@ const SensitiveInput = ({ as = 'input', ...props }: SensitiveInputProps) => {
{...componentProps}
className={`rounded-l-only ${componentProps.className ?? ''}`}
type={
isHidden
? 'password'
: props.type !== 'password'
? (props.type ?? 'text')
: 'text'
props.type === 'textarea'
? undefined
: isHidden
? 'password'
: props.type !== 'password'
? (props.type ?? 'text')
: 'text'
}
style={
props.type === 'textarea' && isHidden
? { WebkitTextSecurity: 'disc', ...props.style }
: props.style
}
/>
<button

View File

@@ -106,7 +106,7 @@ const NotificationsEmail = () => {
otherwise: Yup.string().nullable(),
})
.matches(
/-----BEGIN PGP PRIVATE KEY BLOCK-----.+-----END PGP PRIVATE KEY BLOCK-----/,
/-----BEGIN PGP PRIVATE KEY BLOCK-----.+-----END PGP PRIVATE KEY BLOCK-----/s,
intl.formatMessage(messages.validationPgpPrivateKey)
),
pgpPassword: Yup.string().when('pgpPrivateKey', {