Skip to content

[login] support hosted success redirects - #28745

Merged
rafael-jac merged 6 commits into
mainfrom
codex/hosted-login-success
Jul 7, 2026
Merged

[login] support hosted success redirects#28745
rafael-jac merged 6 commits into
mainfrom
codex/hosted-login-success

Conversation

@rafael-jac

@rafael-jac rafael-jac commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What

Adds an optional hosted login-success redirect path for app-server login requests.

  • Keeps the existing localhost success page as the default.
  • Lets app-server callers opt into a hosted success page with an optional protocol field.
  • Persists credentials before redirecting to the hosted success page.
  • Keeps org setup and existing CLI/device-code login flows on the local success page.
  • Accepts an optional typed appBrand value and forwards it to the hosted page as app_brand so web can select the correct asset.
  • Generates the app-server protocol schema updates for the new optional fields.

Why

This supports the hosted Codex login success page rollout without changing existing login behavior by default. The Codex Apps frontend can gate the opt-in with Statsig after the hosted web page.

Rollout safety

  • Old callers omit the new field and continue using localhost.
  • New callers talking to old app-server builds remain safe because the Codex Apps side treats the field as optional and defaults the flag off.
  • Missing brand values default to Codex.
  • The hosted redirect always uses the app-login source so the hosted page can reopen Codex; the existing streamlined-login visual flag remains separate.

Validation

  • just fmt
  • just fix -p codex-login -p codex-app-server-protocol -p codex-app-server -p codex-app-server-test-client -p codex-tui
  • just test -p codex-login
  • just test -p codex-app-server-protocol
  • just write-app-server-schema
  • git diff HEAD --check

The focused login and protocol run passed all 380 tests.

I also started the broader just test -p codex-app-server; it compiled successfully, then many tests failed on this machine because spawned test servers tried to use the ambient /Users/rafaelj/.codex/sqlite state DB, which is read-only in this sandbox. I stopped that run after confirming the failures shared that environment issue.

@rafael-jac rafael-jac closed this Jun 17, 2026
@rafael-jac
rafael-jac deleted the codex/hosted-login-success branch June 17, 2026 17:57
@rafael-jac
rafael-jac restored the codex/hosted-login-success branch June 26, 2026 18:33
@rafael-jac rafael-jac reopened this Jun 26, 2026
@rafael-jac
rafael-jac force-pushed the codex/hosted-login-success branch from 6cef808 to e90b376 Compare June 26, 2026 19:28
@rafael-jac
rafael-jac enabled auto-merge (squash) June 26, 2026 20:04
Comment thread codex-rs/login/src/server.rs Outdated
Comment thread codex-rs/login/src/server.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/account_processor.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/account_processor.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/account_processor.rs
Comment thread codex-rs/login/src/server.rs Outdated
@celia-oai

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e90b376501

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/app-server-protocol/src/protocol/v2/account.rs Outdated
Comment thread codex-rs/login/src/server.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/account_processor.rs Outdated
Comment thread codex-rs/app-server/README.md Outdated
Comment thread codex-rs/app-server-protocol/src/protocol/v2/account.rs
let request = ClientRequest::LoginAccount {
request_id: RequestId::Integer(3),
params: v2::LoginAccountParams::Chatgpt {
app_brand: None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does app_brand: None only happens when use_hosted_login_success_page is false?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hosted branch still defaults an omitted brand to Codex; device-code login explicitly uses the local LoginSuccessPage default. The shared helper now takes both values explicitly in 944c74e.

Comment thread codex-rs/app-server/src/request_processors/account_processor.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/account_processor.rs
Comment thread codex-rs/login/tests/suite/login_server_e2e.rs
@rafael-jac
rafael-jac requested a review from celia-oai July 7, 2026 13:26
@rafael-jac
rafael-jac merged commit 1fd0858 into main Jul 7, 2026
35 checks passed
@rafael-jac
rafael-jac deleted the codex/hosted-login-success branch July 7, 2026 19:48
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 7, 2026
@rafael-jac

Copy link
Copy Markdown
Contributor Author

/merge

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants