use crate::config;

/// `sprouts logout` — clear the saved session.
pub fn run() -> anyhow::Result<()> {
    let mut config = config::load()?;
    if config.token.is_none() {
        println!("Already logged out.");
        return Ok(());
    }
    config.clear_auth();
    config::save(&config)?;
    println!("Logged out.");
    Ok(())
}
