Files
OmniRoute/src/app/api
Diego Rodrigues de Sa e Souza cb604309ae fix(oauth): require chatgptUserId agreement for Codex account dedup (#7737) (#7825)
Codex OAuth completion (persistOAuthConnection, and the duplicated
exchange/poll/poll-callback pre-checks in the OAuth completion route)
matched an incoming login to an existing connection by email alone
whenever neither side had a workspaceId, silently overwriting a
second distinct Codex account that happens to share an email with
the first. createProviderConnection already disambiguates by
chatgptUserId (#6706), but that path was never reached because the
pre-checks always found an email match first.

Extract the matching logic into a shared
findExistingOAuthConnectionMatch() helper in connectionPersistence.ts
and use it at all 4 OAuth-completion call sites. When neither the
incoming nor existing Codex connection has a workspaceId, only merge
if chatgptUserId agrees; otherwise fall through to
createProviderConnection so its existing disambiguation applies.

Regression test: tests/unit/oauth-connection-persistence-codex-dedup.test.ts
2026-07-20 01:43:39 -03:00
..
2026-07-07 13:14:06 -03:00
2026-04-30 14:08:50 -03:00
2026-04-19 19:50:30 -03:00
2026-06-11 18:52:29 -03:00
2026-07-13 09:12:40 -03:00
2026-05-10 00:55:06 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-06-19 06:49:01 -03:00
2026-07-06 02:25:17 -03:00
2026-07-13 09:12:40 -03:00
2026-05-26 23:51:47 -03:00
2026-07-13 09:12:40 -03:00
2026-07-04 13:00:30 -03:00
2026-06-23 17:06:18 -03:00
2026-05-26 23:51:47 -03:00
2026-04-22 12:26:21 -03:00
2026-06-11 18:52:29 -03:00
2026-07-13 09:12:40 -03:00
2026-06-26 02:51:06 -03:00
2026-06-12 23:49:22 -03:00
2026-07-13 09:12:40 -03:00
2026-06-30 06:54:29 -03:00
2026-06-27 09:07:12 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-06-23 17:06:18 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-06-11 18:52:29 -03:00
2026-06-04 20:05:38 -03:00
2026-06-13 17:27:40 -03:00
2026-05-26 23:51:47 -03:00
2026-06-27 09:07:12 -03:00
2026-07-07 13:14:06 -03:00
2026-05-26 23:51:47 -03:00
2026-07-13 09:12:40 -03:00
2026-05-26 23:51:47 -03:00
2026-07-13 09:12:40 -03:00
2026-07-02 10:47:13 -03:00
2026-05-26 23:51:47 -03:00
2026-05-26 23:51:47 -03:00
2026-04-30 01:27:03 -03:00
2026-07-07 13:14:06 -03:00
2026-06-30 06:54:29 -03:00