Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: add fallback for `isSecret` key (#5157)

Nivedin44d5289a2dfd
diff --git a/packages/hoppscotch-common/src/components/environments/my/Details.vue b/packages/hoppscotch-common/src/components/environments/my/Details.vue
index 92f4970ab..47d7b2e48 100644
--- a/packages/hoppscotch-common/src/components/environments/my/Details.vue
+++ b/packages/hoppscotch-common/src/components/environments/my/Details.vue
@@ -460,7 +460,7 @@ const saveEnvironment = () => {
key: e.key,
currentValue: e.currentValue,
varIndex: i,
- isSecret: e.secret,
+ isSecret: e.secret ?? false,
})
: O.none
)
diff --git a/packages/hoppscotch-common/src/components/environments/teams/Details.vue b/packages/hoppscotch-common/src/components/environments/teams/Details.vue
index 448f8eb2d..3759da777 100644
--- a/packages/hoppscotch-common/src/components/environments/teams/Details.vue
+++ b/packages/hoppscotch-common/src/components/environments/teams/Details.vue
@@ -426,7 +426,7 @@ const saveEnvironment = async () => {
key: e.key,
currentValue: e.currentValue,
varIndex: i,
- isSecret: e.secret,
+ isSecret: e.secret ?? false,
})
: O.none
)
diff --git a/packages/hoppscotch-common/src/helpers/RequestRunner.ts b/packages/hoppscotch-common/src/helpers/RequestRunner.ts
index a706da2e0..eebd69b11 100644
--- a/packages/hoppscotch-common/src/helpers/RequestRunner.ts
+++ b/packages/hoppscotch-common/src/helpers/RequestRunner.ts
@@ -164,7 +164,7 @@ const updateEnvironments = (
nonSecretVariables.push({
key: e.key,
- isSecret: e.secret,
+ isSecret: e.secret ?? false,
varIndex: index,
currentValue: e.currentValue ?? "",
})
diff --git a/packages/hoppscotch-common/src/services/persistence/validation-schemas/index.ts b/packages/hoppscotch-common/src/services/persistence/validation-schemas/index.ts
index 65ad931cd..4a4c75df7 100644
--- a/packages/hoppscotch-common/src/services/persistence/validation-schemas/index.ts
+++ b/packages/hoppscotch-common/src/services/persistence/validation-schemas/index.ts
@@ -386,7 +386,7 @@ export const CURRENT_ENVIRONMENT_VALUE_SCHEMA = z.union([
key: z.string(),
currentValue: z.string(),
varIndex: z.number(),
- isSecret: z.boolean(),
+ isSecret: z.boolean().catch(false),
})
.strict()
)