Skip to content

Commit

Permalink
Merge pull request #1600 from mato-meciar/bugfix/empty-pwd-basic-auth
Browse files Browse the repository at this point in the history
fix(#1545): empty strings encryption
  • Loading branch information
helloanoop authored Feb 21, 2024
2 parents 09c496e + b6abc66 commit c7c7621
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/bruno-electron/src/store/env-secrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class EnvironmentSecretsStore {
}

isValidValue(val) {
return val && typeof val === 'string' && val.length > 0;
return typeof val === 'string' && val.length >= 0;
}

storeEnvSecrets(collectionPathname, environment) {
Expand Down
2 changes: 1 addition & 1 deletion packages/bruno-electron/src/utils/encryption.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function safeStorageDecrypt(str) {
}

function encryptString(str) {
if (!str || typeof str !== 'string' || str.length === 0) {
if (typeof str !== 'string') {
throw new Error('Encrypt failed: invalid string');
}

Expand Down

0 comments on commit c7c7621

Please sign in to comment.