Introduce full backend API surface for projects, snapshots and user pubkeys: controllers, DTOs, JPA entities, repositories, services, and tests. Add SecurityConfig improvements (JWT decoder, audience/issuer/timestamp validation and CORS), a GlobalExceptionHandler for consistent error responses, and remove a stray test call from BackendApplication. Also update README (architecture, docs, CLI/Frontend/Backend notes), add CLAUDE.md, VSCode settings, and multiple frontend/CLI Rust changes. Small housekeeping: add .DS_Store and test adjustments.
27 lines
550 B
Rust
27 lines
550 B
Rust
use anyhow::Result;
|
|
|
|
use crate::config::Config;
|
|
|
|
pub fn run() -> Result<()> {
|
|
let mut config = Config::load()?;
|
|
|
|
if config.auth.is_none() {
|
|
println!("Not currently logged in.");
|
|
return Ok(());
|
|
}
|
|
|
|
let email = config
|
|
.auth
|
|
.as_ref()
|
|
.map(|a| a.user_email.as_str())
|
|
.unwrap_or("unknown")
|
|
.to_string();
|
|
|
|
config.auth = None;
|
|
// Keep the keypair — user can re-authenticate without re-generating keys.
|
|
config.save()?;
|
|
|
|
println!("Logged out ({email}).");
|
|
Ok(())
|
|
}
|