From e8a18d4f537af16b93d02fec3389cf13953b18ba Mon Sep 17 00:00:00 2001
From: Awiteb
Date: Wed, 21 Aug 2024 16:57:12 +0000
Subject: [PATCH] chore: Do not validate password if file exists
Signed-off-by: Awiteb
---
src/utils.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/utils.rs b/src/utils.rs
index 38d0610..9a439c8 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -138,7 +138,7 @@ pub fn master_password_prompt(is_new_vaults_file: bool) -> LprsResult<[u8; 32]>
secret_prompt(
"Master Password:",
is_new_vaults_file,
- Some(vec![Box::new(password_validator)]),
+ is_new_vaults_file.then(|| vec![Box::new(password_validator) as Box]),
)
.map(|p| sha2::Sha256::digest(p).into())
}