aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/command/client/account/delete.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-11 18:02:55 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-11 18:02:55 +0200
commit0b6ca5cb8ca4c46265e08e13053260d9b5cff568 (patch)
tree9dc656095f806e6dd1177e40b9a87cf6d6f10f1b /crates/turtle/src/command/client/account/delete.rs
parentchore(server): Remove the last remnants of the "hub" sync-server thingy (diff)
downloadatuin-0b6ca5cb8ca4c46265e08e13053260d9b5cff568.zip
feat(server): Make user stuff stateless
Diffstat (limited to 'crates/turtle/src/command/client/account/delete.rs')
-rw-r--r--crates/turtle/src/command/client/account/delete.rs45
1 files changed, 0 insertions, 45 deletions
diff --git a/crates/turtle/src/command/client/account/delete.rs b/crates/turtle/src/command/client/account/delete.rs
deleted file mode 100644
index 722c39ec..00000000
--- a/crates/turtle/src/command/client/account/delete.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-use crate::atuin_client::{auth, settings::Settings};
-use clap::Parser;
-use eyre::{Result, bail};
-
-use super::login::read_user_password;
-
-#[derive(Parser, Debug)]
-pub(crate) struct Cmd {
- #[clap(long, short)]
- pub(crate) password: Option<String>,
-
- /// The two-factor authentication code for your account, if any
- #[clap(long, short)]
- pub(crate) totp_code: Option<String>,
-}
-
-impl Cmd {
- pub(crate) async fn run(&self, settings: &Settings) -> Result<()> {
- if !settings.logged_in().await? {
- bail!("You are not logged in");
- }
-
- let client = auth::auth_client(settings).await;
-
- let password = self.password.clone().unwrap_or_else(read_user_password);
-
- if password.is_empty() {
- bail!("please provide your password");
- }
-
- let mut totp_code = self.totp_code.clone();
-
- client
- .delete_account(&password, totp_code.as_deref())
- .await?;
-
- // Clean up sessions from meta store
- let meta = Settings::meta_store().await?;
- meta.delete_session().await?;
-
- println!("Your account is deleted");
-
- Ok(())
- }
-}