feat: refactor CodexAuth so invalid state cannot be represented

This commit is contained in:
Michael Bolin
2026-01-29 22:59:37 -08:00
parent a9cf449a80
commit 4f2a604b04
13 changed files with 286 additions and 165 deletions
+1 -1
View File
@@ -225,7 +225,7 @@ pub async fn run_login_status(cli_config_overrides: CliConfigOverrides) -> ! {
let config = load_config_or_exit(cli_config_overrides).await;
match CodexAuth::from_auth_storage(&config.codex_home, config.cli_auth_credentials_store_mode) {
Ok(Some(auth)) => match auth.mode {
Ok(Some(auth)) => match auth.api_auth_mode() {
AuthMode::ApiKey => match auth.get_token() {
Ok(api_key) => {
eprintln!("Logged in using an API key - {}", safe_format_key(&api_key));