From cc28dc7230731c61e36577917113837ded0dfe3b Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2026 18:45:42 +0000 Subject: [PATCH] fix: warn on config parse errors during auth login When `storage::load_config()` fails in the auth login path, add an `.inspect_err()` call that prints a warning to stderr before falling back to defaults. Previously, parse errors were silently swallowed, which could cause users with custom api_url/app_url settings to unknowingly authenticate against production. Closes #307 Co-Authored-By: Sachin Iyer --- src/commands/auth.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands/auth.rs b/src/commands/auth.rs index b17c034..30ff567 100644 --- a/src/commands/auth.rs +++ b/src/commands/auth.rs @@ -39,7 +39,13 @@ pub enum AuthCommands { pub async fn handle(command: &AuthCommands, cli: &crate::Cli) -> Result<()> { match command { AuthCommands::Login { token } => { - let config = storage::load_config().unwrap_or_default(); + let config = storage::load_config() + .inspect_err(|e| { + let _ = Term::stderr().write_line(&format!( + "Warning: Config file has errors, using default settings: {e}" + )); + }) + .unwrap_or_default(); let api_url = config .api_url .as_deref()