Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix bug with copying secret to clipboard with an override

Shreyas Singhc9f01ce0867c
diff --git a/frontend/src/views/SecretMainPage/components/SecretListView/SecretItem.tsx b/frontend/src/views/SecretMainPage/components/SecretListView/SecretItem.tsx
index c420cdd07f..9c92ae6b83 100644
--- a/frontend/src/views/SecretMainPage/components/SecretListView/SecretItem.tsx
+++ b/frontend/src/views/SecretMainPage/components/SecretListView/SecretItem.tsx
@@ -172,7 +172,11 @@ export const SecretItem = memo(
const copyTokenToClipboard = () => {
const [overrideValue, value] = getValues(["value", "valueOverride"]);
- navigator.clipboard.writeText((overrideValue || value) as string);
+ if (isOverriden) {
+ navigator.clipboard.writeText(value as string);
+ } else {
+ navigator.clipboard.writeText(overrideValue as string);
+ }
setIsSecValueCopied.on();
};