You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a Paste JSON flow to the Auth Files page so users can create auth files without uploading a local file.
Added a new AuthJsonPasteModal with auth type selection, file name validation, JSON textarea input, and save/error states.
Added sessionAuthConverter to validate CPA auth JSON directly or convert ChatGPT Web session JSON into CPA Codex auth format.
Added public-behavior tests for CPA passthrough, session conversion, invalid access token rejection, and safe default file names.
Added localized UI strings for English, Russian, Simplified Chinese, and Traditional Chinese.
Hardened auth file text saving so upload failures raise an error instead of being treated as success.
Why
Users may only have auth/session JSON copied from another source and should not need to create a temporary local file before importing it into CPA Manager.
Impact
The Auth Files page now has a Paste JSON action next to upload. CPA JSON is saved as-is after object validation. ChatGPT Web session JSON is converted into the CPA Codex auth shape before upload, including account identity, token fields, expiration, and a safe generated file name when the default name is used.
Validation
npm test -- --run src/features/authFiles/sessionAuthConverter.test.ts
Thanks for the PR. The feature direction looks good, and the paste-based JSON import flow is useful.
I’d suggest a few changes before merging:
Please don’t synthesize an unsigned id_token with alg: none. If no real idToken exists, either omit id_token or reject the import with a clear error.
expired should not prefer the access token exp, since access tokens are often short-lived. Explicit session expiration fields should take priority.
Session detection seems a bit strict. Real session JSON may split token and user/profile data across different nested fields, so a root-level aggregation path would make this more robust.
CPA JSON passthrough should have minimal validation. Right now any object like { "foo": "bar" } could be saved as an auth file.
Please add a few edge-case tests for missing idToken, expiration priority, nested session/user structures, invalid CPA JSON, and malformed JWTs.
Also, GitHub flags hidden/bidirectional Unicode in some changed files, so please clean those up before merging.
Overall, I support the feature, but I’d request changes before merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Adds a Paste JSON flow to the Auth Files page so users can create auth files without uploading a local file.
AuthJsonPasteModalwith auth type selection, file name validation, JSON textarea input, and save/error states.sessionAuthConverterto validate CPA auth JSON directly or convert ChatGPT Web session JSON into CPA Codex auth format.Why
Users may only have auth/session JSON copied from another source and should not need to create a temporary local file before importing it into CPA Manager.
Impact
The Auth Files page now has a
Paste JSONaction next to upload. CPA JSON is saved as-is after object validation. ChatGPT Web session JSON is converted into the CPA Codex auth shape before upload, including account identity, token fields, expiration, and a safe generated file name when the default name is used.Validation
npm test -- --run src/features/authFiles/sessionAuthConverter.test.tsnpm run build