mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 08:06:19 +00:00
fix(ui): restore standard Codex API key setup
Remove command-backed provider auth from the generated configuration and use auth.json again. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -35,23 +35,13 @@ const configPath = computed(() =>
|
||||
? '%userprofile%\\.codex\\config.toml'
|
||||
: '~/.codex/config.toml',
|
||||
)
|
||||
const tokenPath = computed(() =>
|
||||
activePlatform.value === 'windows'
|
||||
? '%userprofile%\\.codex\\codex-proxy.token'
|
||||
: '~/.codex/codex-proxy.token',
|
||||
const authPath = computed(() =>
|
||||
activePlatform.value === 'windows' ? '%userprofile%\\.codex\\auth.json' : '~/.codex/auth.json',
|
||||
)
|
||||
const codexAuthJson = computed(() => JSON.stringify({ OPENAI_API_KEY: keyValue.value }, null, 2))
|
||||
const defaultModel = computed(() =>
|
||||
props.apiKey?.providerKind?.trim().toLowerCase() === 'xai' ? 'grok-4.5' : 'gpt-5.5',
|
||||
)
|
||||
const providerAuthToml = computed(() =>
|
||||
activePlatform.value === 'windows'
|
||||
? `[model_providers.OpenAI.auth]
|
||||
command = "powershell.exe"
|
||||
args = ["-NoLogo", "-NoProfile", "-NonInteractive", "-Command", "Get-Content -Raw (Join-Path (Join-Path $env:USERPROFILE '.codex') 'codex-proxy.token')"]`
|
||||
: `[model_providers.OpenAI.auth]
|
||||
command = "sh"
|
||||
args = ["-c", 'cat "$HOME/.codex/codex-proxy.token"']`,
|
||||
)
|
||||
|
||||
const codexConfigToml = computed(
|
||||
() => `model_provider = "OpenAI"
|
||||
@@ -67,8 +57,7 @@ windows_wsl_setup_acknowledged = true
|
||||
name = "OpenAI"
|
||||
base_url = "${props.apiBaseUrl}"
|
||||
wire_api = "responses"
|
||||
|
||||
${providerAuthToml.value}
|
||||
requires_openai_auth = true
|
||||
|
||||
[features]
|
||||
goals = true`,
|
||||
@@ -76,7 +65,7 @@ goals = true`,
|
||||
|
||||
const visibleFiles = computed(() => [
|
||||
{ path: configPath.value, content: codexConfigToml.value },
|
||||
{ path: tokenPath.value, content: keyValue.value },
|
||||
{ path: authPath.value, content: codexAuthJson.value },
|
||||
])
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user