refact(password): simplify

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2026-05-21 15:04:32 +08:00
parent 9e00fa2762
commit 8e0c8ab939
2 changed files with 16 additions and 48 deletions

View File

@@ -1429,15 +1429,11 @@ impl Config {
Self::get_salt()
}
fn has_usable_local_permanent_password() -> bool {
pub fn has_local_permanent_password() -> bool {
let (local_storage, local_salt) = Self::get_local_permanent_password_storage_and_salt();
local_permanent_password_storage_is_usable_for_auth(&local_storage, &local_salt)
}
pub fn has_local_permanent_password() -> bool {
Self::has_usable_local_permanent_password()
}
// This shouldn't happen under normal circumstances because the salt
// should be automatically generated when migrating to hash storage.
// Actually, it is better to avoid calling set_salt at all.