fix(core,cli): end the session on Proton when signing out

Logout only deleted the keyring entry, so the session's tokens stayed
valid on Proton's side. It now ends the session first (DELETE auth/v4,
bounded to 10 s) and signs out locally either way. `pdfs logout` says
when Proton could not be reached (B233).
This commit is contained in:
nvrl committed 2026-10-16 11:26:29 +02:00
1 parent ef0f046939
commit 518763c5c9
5 files changed
+88 -7

No files matched your search

+8 -2
View File
@@ -1977,8 +1977,14 @@ fn key_state_name() -> &'static str {
}
fn cmd_logout() -> Result<()> {
auth::logout()?;
println!("Stored session cleared.");
if auth::logout()? {
println!("Signed out: the session is ended on Proton and cleared here.");
} else {
println!(
"Stored session cleared. Proton could not be reached to end the session; \
it stays valid until it expires or is signed out in your account's security settings."
);
}
Ok(())
}