diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-10 23:12:17 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-10 23:12:17 +0200 |
| commit | 9eb2ffb2e9b52cdec70acb268e7a12131811db10 (patch) | |
| tree | 4db12e8f58aee8aba614bab7d5d7803a5807ef0e /crates/atuin-client/src/login.rs | |
| parent | chore: Remove more (kinda) useless stuff (diff) | |
| download | atuin-9eb2ffb2e9b52cdec70acb268e7a12131811db10.zip | |
chore: Somewhat simplify sync code
Diffstat (limited to 'crates/atuin-client/src/login.rs')
| -rw-r--r-- | crates/atuin-client/src/login.rs | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/crates/atuin-client/src/login.rs b/crates/atuin-client/src/login.rs index d72d1c09..2545e890 100644 --- a/crates/atuin-client/src/login.rs +++ b/crates/atuin-client/src/login.rs @@ -7,7 +7,7 @@ use tokio::io::AsyncWriteExt; use crate::{ api_client, - encryption::{Key, decode_key, encode_key, load_key}, + encryption::{decode_key, load_key}, record::{sqlite_store::SqliteStore, store::Store}, settings::Settings, }; @@ -19,25 +19,6 @@ pub async fn login( password: String, key: String, ) -> Result<String> { - // try parse the key as a mnemonic... - let key = match bip39::Mnemonic::from_phrase(&key, bip39::Language::English) { - Ok(mnemonic) => encode_key(Key::from_slice(mnemonic.entropy()))?, - Err(err) => { - match err { - // assume they copied in the base64 key - bip39::ErrorKind::InvalidWord(_) => key, - bip39::ErrorKind::InvalidChecksum => { - bail!("key mnemonic was not valid") - } - bip39::ErrorKind::InvalidKeysize(_) - | bip39::ErrorKind::InvalidWordLength(_) - | bip39::ErrorKind::InvalidEntropyLength(_, _) => { - bail!("key was not the correct length") - } - } - } - }; - let key_path = settings.key_path.as_str(); let key_path = PathBuf::from(key_path); |
