Files
DeepTutor/tests/api
Bingxi Zhao (Frank) 7a5102a8cd fix(codex-auth): route the OAuth callback by state, not by request user
The remote callback endpoint added in #716 cannot be authenticated: the
browser reaches /auth/callback on the far end of the user's own tunnel,
a different origin from the DeepTutor Web session, so no cookie is sent.
The user ContextVar is only ever set inside require_auth, which left
get_codex_oauth_service() resolving every callback to the default root
while the login operation lived under data/users/<id> — so remote Codex
sign-in returned login_not_active for every non-administrator.

Deliver by OAuth state instead. The state is a secret this process
minted for exactly one login and is compared in constant time, which is
already the trust model the loopback listener uses; no new authorization
surface is opened. Delivery keeps the endpoint's existing status codes:
409 when nothing is waiting, 400 when a login is waiting but the state
does not match.

The PR's endpoint tests monkeypatched the service factory, so user
resolution was never exercised; they now patch the delivery seam, and
three service-level tests cover routing to a non-default instance.
2026-07-28 19:20:57 +08:00
..
2026-06-11 20:03:34 +08:00
2026-06-11 20:03:34 +08:00
2026-06-18 00:22:48 +08:00
2026-06-17 10:50:44 +08:00
2026-06-11 20:03:34 +08:00
2026-07-04 15:49:11 +08:00
2026-06-11 20:03:34 +08:00
2026-05-08 02:36:24 +08:00
2026-06-21 14:43:41 +08:00
2026-06-18 00:22:48 +08:00
2026-06-18 00:22:48 +08:00