mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
## Summary When using device-code login with a custom issuer (`--experimental_issuer`), Codex correctly uses that issuer for the auth flow β but the **terminal prompt still told users to open the default OpenAI device URL** (`https://auth.openai.com/codex/device`). Thatβs confusing and can send users to the **wrong domain** (especially for enterprise/staging issuers). This PR updates the prompt (and related URLs) to consistently use the configured issuer. π― --- ## π§ What changed * π **Device auth prompt link** now uses the configured issuer (instead of a hard-coded OpenAI URL) * π§ **Redirect callback URL** is derived from the same issuer for consistency * π§Ό Minor cleanup: normalize the issuer base URL once and reuse it (avoids formatting quirks like trailing `/`) --- ## π§ͺ Repro + Before/After ### βΆοΈ Command ```bash codex login --device-auth --experimental_issuer https://auth.example.com ``` ### β Before (wrong link shown) ```text 1. Open this link in your browser and sign in to your account https://auth.openai.com/codex/device ``` ### β After (correct link shown) ```text 1. Open this link in your browser and sign in to your account https://auth.example.com/codex/device ``` Full example output (same as before, but with the correct URL): ```text Welcome to Codex [v0.72.0] OpenAI's command-line coding agent Follow these steps to sign in with ChatGPT using device code authorization: 1. Open this link in your browser and sign in to your account https://auth.example.com/codex/device 2. Enter this one-time code (expires in 15 minutes) BUT6-0M8K4 Device codes are a common phishing target. Never share this code. ``` --- ## β Test plan * π¦ `codex login --device-auth` (default issuer): output remains unchanged * π© `codex login --device-auth --experimental_issuer https://auth.example.com`: * prompt link points to the issuer β * callback URL is derived from the same issuer β * no double slashes / mismatched domains β Co-authored-by: Eric Traut <etraut@openai.com>