fix: hidden secret value in secret approvals

This commit is contained in:
Daniel Hougaard
2025-06-13 18:45:48 +04:00
parent b43ecef112
commit d5e9ac82d0
5 changed files with 78 additions and 26 deletions
@@ -48,6 +48,7 @@ const syntaxHighlight = (content?: string | null, isVisible?: boolean, isImport?
type Props = TextareaHTMLAttributes<HTMLTextAreaElement> & {
value?: string | null;
isVisible?: boolean;
valueAlwaysHidden?: boolean;
isImport?: boolean;
isReadOnly?: boolean;
isDisabled?: boolean;
@@ -63,6 +64,7 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
value,
isVisible,
isImport,
valueAlwaysHidden,
containerClassName,
onBlur,
isDisabled,
@@ -84,7 +86,11 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
<pre aria-hidden className="m-0">
<code className={`inline-block w-full ${commonClassName}`}>
<span style={{ whiteSpace: "break-spaces" }}>
{syntaxHighlight(value, isVisible || isSecretFocused, isImport)}
{syntaxHighlight(
value,
isVisible || (isSecretFocused && !valueAlwaysHidden),
isImport
)}
</span>
</code>
</pre>