fix(password): remove unnecessary check

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2026-03-22 19:11:26 +08:00
parent fc9d521f0b
commit ebf41b8524

View File

@@ -1271,8 +1271,6 @@ impl Config {
}
/// Persist permanent password storage and salt from service->user config sync.
///
/// This never accepts plaintext. `storage` must be empty or a valid hashed verifier storage.
pub fn set_permanent_password_storage_for_sync(
storage: &str,
salt: &str,
@@ -1289,15 +1287,6 @@ impl Config {
return Ok(true);
}
if salt.is_empty() {
return Err(anyhow!(
"Refusing to persist hashed permanent password without salt"
));
}
if decode_permanent_password_h1_from_storage(storage).is_none() {
return Err(anyhow!("Invalid hashed permanent password storage"));
}
if config.password == storage && config.salt == salt {
return Ok(false);
}