mirror of
https://github.com/openai/codex.git
synced 2026-11-13 06:45:07 +00:00
Send account id when available (#1767)
For users with multiple accounts we need to specify the account to use.
This commit is contained in:
1 parent
6ce0a5875b
commit
0935e6a875
3 files changed
+21
-2
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user