From 60358edbc30feb5df68c3870a0d44f8e22723315 Mon Sep 17 00:00:00 2001 From: Joscha Date: Sun, 24 Jul 2022 19:02:15 +0200 Subject: [PATCH] Add command to clear cookies --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.rs b/src/main.rs index 80777b0..d6454ef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,7 @@ mod vault; use std::path::PathBuf; use clap::Parser; +use cookie::CookieJar; use directories::ProjectDirs; use log::info; use toss::terminal::Terminal; @@ -30,6 +31,8 @@ enum Command { Export { room: String, file: PathBuf }, /// Compact and clean up vault. Gc, + /// Clear euphoria session cookies. + ClearCookies, } impl Default for Command { @@ -61,6 +64,10 @@ async fn main() -> anyhow::Result<()> { println!("This may take a while..."); vault.gc().await; } + Command::ClearCookies => { + println!("Clearing cookies"); + vault.set_euph_cookies(CookieJar::new()).await; + } } vault.close().await;