feat: implement admin account deletion endpoint

This commit is contained in:
ispik
2026-04-12 14:49:41 +03:00
parent 5e98a01624
commit 9a67cb139c
2 changed files with 69 additions and 0 deletions

View File

@@ -268,4 +268,20 @@ impl Database {
Ok(())
}
pub async fn delete_authifier_account(&self, user_id: &str) -> Result<()> {
let auth = self.clone().to_authifier().await;
let mut account = auth
.database
.find_account(user_id)
.await
.map_err(|_| create_database_error!("find_account", "accounts"))?;
account
.schedule_deletion(&auth)
.await
.map_err(|_| create_database_error!("schedule_deletion", "accounts"))?;
Ok(())
}
}