feat: revoke OAuth token when logging out

This commit is contained in:
ThetaDev 2024-10-24 01:30:59 +02:00
parent d452af4fb7
commit 62f8a9210c
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
2 changed files with 70 additions and 7 deletions

View file

@ -193,6 +193,8 @@ enum Commands {
Vdata,
/// Log in using your Google account
Login,
/// Log out from your Google account
Logout,
}
#[derive(Default, Copy, Clone, ValueEnum)]
@ -1226,6 +1228,10 @@ async fn run() -> anyhow::Result<()> {
}
anstream::println!("{}", "Logged in.".green());
}
Commands::Logout => {
rp.user_auth_logout().await?;
anstream::println!("{}", "Logged out.".red());
}
};
Ok(())
}