mirror of
https://github.com/atuinsh/atuin.git
synced 2025-04-12 15:38:22 +02:00
* feat(gui): use fancy new side nav * compact only sidebar, no expand-collapse * custom drag region, remove titlebar * add user popup * wire up login/logout/register, move user button to bottom and add menu * link help and feedback to forum
18 lines
419 B
Rust
18 lines
419 B
Rust
use eyre::{Context, Result};
|
|
use fs_err::remove_file;
|
|
|
|
use crate::settings::Settings;
|
|
|
|
pub fn logout(settings: &Settings) -> Result<()> {
|
|
let session_path = settings.session_path.as_str();
|
|
|
|
if settings.logged_in() {
|
|
remove_file(session_path).context("Failed to remove session file")?;
|
|
println!("You have logged out!");
|
|
} else {
|
|
println!("You are not logged in");
|
|
}
|
|
|
|
Ok(())
|
|
}
|