From 44d5289a2dfdf5921b0b470c80fb5b1b622644c5 Mon Sep 17 00:00:00 2001 From: Nivedin <53208152+nivedin@users.noreply.github.com> Date: Mon, 16 Jun 2025 18:22:52 +0530 Subject: [PATCH] fix: add fallback for `isSecret` key (#5157) --- .../src/components/environments/my/Details.vue | 2 +- .../src/components/environments/teams/Details.vue | 2 +- packages/hoppscotch-common/src/helpers/RequestRunner.ts | 2 +- .../src/services/persistence/validation-schemas/index.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/hoppscotch-common/src/components/environments/my/Details.vue b/packages/hoppscotch-common/src/components/environments/my/Details.vue index 92f4970a..47d7b2e4 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 448f8eb2..3759da77 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 a706da2e..eebd69b1 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 65ad931c..4a4c75df 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() )