Skip to content

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

Solved the issue with empty secret names

Vladyslav Matsiiako38efb6a1e2e5
diff --git a/frontend/src/pages/dashboard/[id].tsx b/frontend/src/pages/dashboard/[id].tsx
index 6c4483d499..9c485ebba1 100644
--- a/frontend/src/pages/dashboard/[id].tsx
+++ b/frontend/src/pages/dashboard/[id].tsx
@@ -419,9 +419,20 @@ export default function Dashboard() {
const nameErrors = !newData!
.map((secret) => !Number.isNaN(Number(secret.key.charAt(0))))
.every((v) => v === false);
+ const emptyNameError = !newData!
+ .map((secret) => secret.key.length === 0)
+ .every((v) => v === false);
const duplicatesExist =
findDuplicates(data!.map((item: SecretDataProps) => item.key)).length > 0;
+ if (emptyNameError) {
+ setSaveLoading(false);
+ return createNotification({
+ text: 'You can`t submit empty secret names.',
+ type: 'error'
+ });
+ }
+
if (nameErrors) {
setSaveLoading(false);
return createNotification({