From 9eb2ffb2e9b52cdec70acb268e7a12131811db10 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 10 Jun 2026 23:12:17 +0200 Subject: chore: Somewhat simplify sync code --- crates/atuin-client/src/login.rs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'crates/atuin-client/src/login.rs') 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 { - // 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); -- cgit v1.3.1