Add command to clear cookies
This commit is contained in:
parent
096e3f7cfd
commit
60358edbc3
1 changed files with 7 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ mod vault;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
use cookie::CookieJar;
|
||||||
use directories::ProjectDirs;
|
use directories::ProjectDirs;
|
||||||
use log::info;
|
use log::info;
|
||||||
use toss::terminal::Terminal;
|
use toss::terminal::Terminal;
|
||||||
|
|
@ -30,6 +31,8 @@ enum Command {
|
||||||
Export { room: String, file: PathBuf },
|
Export { room: String, file: PathBuf },
|
||||||
/// Compact and clean up vault.
|
/// Compact and clean up vault.
|
||||||
Gc,
|
Gc,
|
||||||
|
/// Clear euphoria session cookies.
|
||||||
|
ClearCookies,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Command {
|
impl Default for Command {
|
||||||
|
|
@ -61,6 +64,10 @@ async fn main() -> anyhow::Result<()> {
|
||||||
println!("This may take a while...");
|
println!("This may take a while...");
|
||||||
vault.gc().await;
|
vault.gc().await;
|
||||||
}
|
}
|
||||||
|
Command::ClearCookies => {
|
||||||
|
println!("Clearing cookies");
|
||||||
|
vault.set_euph_cookies(CookieJar::new()).await;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vault.close().await;
|
vault.close().await;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue