chore: Do not validate password if file exists

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb 2024-08-21 16:57:12 +00:00
parent 75625f53b4
commit e8a18d4f53
Signed by: awiteb
GPG key ID: 3F6B55640AA6682F

View file

@ -138,7 +138,7 @@ pub fn master_password_prompt(is_new_vaults_file: bool) -> LprsResult<[u8; 32]>
secret_prompt( secret_prompt(
"Master Password:", "Master Password:",
is_new_vaults_file, is_new_vaults_file,
Some(vec![Box::new(password_validator)]), is_new_vaults_file.then(|| vec![Box::new(password_validator) as Box<dyn StringValidator>]),
) )
.map(|p| sha2::Sha256::digest(p).into()) .map(|p| sha2::Sha256::digest(p).into())
} }