feat(providers/codex): bulk add accounts via JSON
Add a "Bulk Add" button on /dashboard/providers/codex that imports
multiple OAuth accounts at once by pasting a JSON array, single object,
or { accounts: [...] } wrapper.
- New endpoint POST /api/oauth/codex/bulk-import (serial loop, no token echo)
- New BulkImportCodexModal component with JSON textarea + success/failure summary
- Persist idToken/lastRefreshAt on first insert via OPTIONAL_FIELDS
- Backfill email/chatgptAccountId/chatgptPlanType from JWT when missing
- Derive expiresAt from expiresIn when missing
- Gated to providerId === "codex" only; other providers unaffected
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,7 +7,7 @@ const OPTIONAL_FIELDS = [
|
||||
"accessToken", "refreshToken", "expiresAt", "tokenType",
|
||||
"scope", "projectId", "apiKey", "testStatus",
|
||||
"lastTested", "lastError", "lastErrorAt", "rateLimitedUntil", "expiresIn", "errorCode",
|
||||
"consecutiveUseCount",
|
||||
"consecutiveUseCount", "idToken", "lastRefreshAt",
|
||||
];
|
||||
|
||||
function rowToConn(row) {
|
||||
|
||||
Reference in New Issue
Block a user