aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/atuin_client/logout.rs
blob: 343934b9e7f26c3a08991ecc00e7ad3710aa6419 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use eyre::Result;

use crate::atuin_client::settings::Settings;

pub async fn logout() -> Result<()> {
    let meta = Settings::meta_store().await?;

    if meta.logged_in().await? {
        meta.delete_session().await?;
        println!("You have logged out!");
    } else {
        println!("You are not logged in");
    }

    Ok(())
}