Bug Description
After completing OAuth login for Qwen AI (International) and Z.ai through the in-app login window, the provider and account data are not saved to data.json. The provider management page shows no newly added providers.
Environment
- Chat2API version: 1.3.0
- OS: macOS (Apple Silicon)
- Electron: bundled version
Steps to Reproduce
- Open Chat2API
- Go to Provider Management → Add Provider → Select "Qwen AI (International)"
- Complete OAuth login in the popup window (Google login → chat.qwen.ai)
- Close the login window after successful authentication
- Check Provider Management page
Expected: Qwen AI (International) appears in the provider list with the account
Actual: Provider does not appear. Decrypting data.json confirms providers and accounts arrays remain empty/unchanged.
Additional Details
Issue 1: OAuth token extraction failure
The OAuth window creates a browser partition under ~/Library/Application Support/chat2api/Partitions/oauth-* and cookies are saved correctly (including the JWT token in cookies). However, the token is not extracted from localStorage (where the app looks for it via TOKEN_EXTRACTION_CONFIGS["qwen-ai"].tokenSources). The page may not have fully loaded the token into localStorage before extraction runs.
Older sessions (earlier partitions) do have the token key in localStorage, but newer ones sometimes don't — suggesting a race condition.
Issue 2: Z.ai OAuth creates guest accounts
When using the in-app OAuth window for Z.ai (chat.z.ai), the login flow creates guest accounts (guest-xxx@guest.com) instead of completing the Google OAuth flow. The ZaiAdapter then rejects these tokens as guest accounts.
Workaround
Manually decrypt data.json (using the conf v14 encryption: aes-256-cbc + pbkdf2Sync), inject the provider and account objects, re-encrypt, and restart the app.
Alternatively, obtain the JWT token from the browser's LocalStorage (F12 → Application → Local Storage) and use the "manual token" input — though the paste functionality in the token input field also has issues on macOS.
Bug Description
After completing OAuth login for Qwen AI (International) and Z.ai through the in-app login window, the provider and account data are not saved to
data.json. The provider management page shows no newly added providers.Environment
Steps to Reproduce
Expected: Qwen AI (International) appears in the provider list with the account
Actual: Provider does not appear. Decrypting
data.jsonconfirmsprovidersandaccountsarrays remain empty/unchanged.Additional Details
Issue 1: OAuth token extraction failure
The OAuth window creates a browser partition under
~/Library/Application Support/chat2api/Partitions/oauth-*and cookies are saved correctly (including the JWT token in cookies). However, the token is not extracted fromlocalStorage(where the app looks for it viaTOKEN_EXTRACTION_CONFIGS["qwen-ai"].tokenSources). The page may not have fully loaded the token into localStorage before extraction runs.Older sessions (earlier partitions) do have the
tokenkey in localStorage, but newer ones sometimes don't — suggesting a race condition.Issue 2: Z.ai OAuth creates guest accounts
When using the in-app OAuth window for Z.ai (chat.z.ai), the login flow creates guest accounts (
guest-xxx@guest.com) instead of completing the Google OAuth flow. TheZaiAdapterthen rejects these tokens as guest accounts.Workaround
Manually decrypt
data.json(using theconfv14 encryption:aes-256-cbc+pbkdf2Sync), inject the provider and account objects, re-encrypt, and restart the app.Alternatively, obtain the JWT token from the browser's LocalStorage (F12 → Application → Local Storage) and use the "manual token" input — though the paste functionality in the token input field also has issues on macOS.