diff options
author | Alex Auvolat <alex@adnab.me> | 2022-05-23 17:36:08 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-05-23 17:36:08 +0200 |
commit | 53881fdb21a3bcde82055bcf758032cabd76b864 (patch) | |
tree | 0f85d944ef1909bb196f8a1f5e12f1f61a091ac6 | |
parent | cb9b64a184470c7f332eb2c20bf64d53e84406f1 (diff) | |
download | aerogramme-53881fdb21a3bcde82055bcf758032cabd76b864.tar.gz aerogramme-53881fdb21a3bcde82055bcf758032cabd76b864.zip |
Delete password easilyier
-rw-r--r-- | src/login/mod.rs | 1 | ||||
-rw-r--r-- | src/main.rs | 11 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/login/mod.rs b/src/login/mod.rs index 1ee0007..2640a58 100644 --- a/src/login/mod.rs +++ b/src/login/mod.rs @@ -318,7 +318,6 @@ impl CryptoKeys { } pub async fn delete_password( - &self, storage: &StorageCredentials, password: &str, allow_delete_all: bool, diff --git a/src/main.rs b/src/main.rs index 088c86f..ada94fc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -218,14 +218,17 @@ async fn main() -> Result<()> { let existing_password = rpassword::prompt_password("Enter password to delete: ")?; - let keys = CryptoKeys::open(&creds, &user_secrets, &existing_password).await?; - keys.delete_password(&creds, &existing_password, allow_delete_all) - .await?; + let keys = match allow_delete_all { + true => Some(CryptoKeys::open(&creds, &user_secrets, &existing_password).await?), + false => None, + }; + + CryptoKeys::delete_password(&creds, &existing_password, allow_delete_all).await?; println!(""); println!("Password was deleted successfully."); - if allow_delete_all { + if let Some(keys) = keys { println!("As a reminder, here are your cryptographic keys:"); dump_keys(&keys); } |