Send account id when available (#1767)

For users with multiple accounts we need to specify the account to use.
This commit is contained in:
pakrym-oai
2025-07-31 15:40:19 -07:00
committed by GitHub
parent 6ce0a5875b
commit 0935e6a875
3 changed files with 21 additions and 2 deletions

View File

@@ -123,6 +123,17 @@ impl CodexAuth {
}
}
}
pub async fn get_account_id(&self) -> Option<String> {
match self.mode {
AuthMode::ApiKey => None,
AuthMode::ChatGPT => {
let token_data = self.get_token_data().await.ok()?;
token_data.account_id.clone()
}
}
}
}
// Loads the available auth information from the auth.json or OPENAI_API_KEY environment variable.