diff --git a/codex-rs/app-server/src/request_processors/account_processor.rs b/codex-rs/app-server/src/request_processors/account_processor.rs index 4dff7324aa..e78e17c9e1 100644 --- a/codex-rs/app-server/src/request_processors/account_processor.rs +++ b/codex-rs/app-server/src/request_processors/account_processor.rs @@ -569,13 +569,10 @@ impl AccountRequestProcessor { } if let Some(expected_workspaces) = self.config.forced_chatgpt_workspace_id.as_deref() - && !expected_workspaces - .iter() - .any(|expected_workspace| chatgpt_account_id == *expected_workspace) + && !expected_workspaces.contains(&chatgpt_account_id) { return Err(invalid_request(format!( - "External auth must use one of workspace(s) {:?}, but received {chatgpt_account_id:?}.", - expected_workspaces + "External auth must use one of workspace(s) {expected_workspaces:?}, but received {chatgpt_account_id:?}.", ))); } diff --git a/codex-rs/login/src/auth/manager.rs b/codex-rs/login/src/auth/manager.rs index def9b7965d..0483a72d93 100644 --- a/codex-rs/login/src/auth/manager.rs +++ b/codex-rs/login/src/auth/manager.rs @@ -1841,9 +1841,7 @@ impl AuthManager { ))); }; if let Some(expected_workspace_ids) = forced_chatgpt_workspace_id.as_deref() - && !expected_workspace_ids - .iter() - .any(|expected| chatgpt_metadata.account_id == *expected) + && !expected_workspace_ids.contains(&chatgpt_metadata.account_id) { return Err(RefreshTokenError::Transient(std::io::Error::other( format!(