mirror of
https://github.com/openai/codex.git
synced 2026-11-20 22:40:37 +00:00
Support multiple forced ChatGPT workspaces
This commit is contained in:
@@ -1677,13 +1677,16 @@ impl CodexMessageProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(expected_workspace) = self.config.forced_chatgpt_workspace_id.as_deref()
|
||||
&& chatgpt_account_id != expected_workspace
|
||||
if let Some(expected_workspaces) = self.config.forced_chatgpt_workspace_id.as_deref()
|
||||
&& !expected_workspaces
|
||||
.iter()
|
||||
.any(|expected_workspace| chatgpt_account_id == *expected_workspace)
|
||||
{
|
||||
let error = JSONRPCErrorError {
|
||||
code: INVALID_REQUEST_ERROR_CODE,
|
||||
message: format!(
|
||||
"External auth must use workspace {expected_workspace}, but received {chatgpt_account_id:?}."
|
||||
"External auth must use one of workspace(s) {:?}, but received {chatgpt_account_id:?}.",
|
||||
expected_workspaces
|
||||
),
|
||||
data: None,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user