Repository navigation
Conversation
|
There was a problem hiding this comment.
Code Review
This pull request updates the OAuth exchange logic to support the 'cline' provider, improves error reporting in the frontend modal, and refactors Qoder unit tests to use fetch mocking instead of local CLI scripts. It also adjusts the Gemini token limit and makes the OAuth schema more flexible for non-PKCE flows. Feedback was provided to improve the normalization of the 'state' parameter by trimming whitespace to handle empty strings more robustly.
|
|
||
| if (action === "exchange") { | ||
| const { code, redirectUri, codeVerifier, state } = body; | ||
| const normalizedState = typeof state === "string" && state.length > 0 ? state : undefined; |
There was a problem hiding this comment.
The normalization of state to undefined when it is an empty string or null is a good fix for providers like Cline. However, consider using .trim() to also handle strings containing only whitespace, which are effectively empty in the context of OAuth state.
| const normalizedState = typeof state === "string" && state.length > 0 ? state : undefined; | |
| const normalizedState = typeof state === "string" && state.trim().length > 0 ? state : undefined; |
|
Thanks @wlfonseca for this great contribution! 🎉 The PR has been integrated into the release/v3.5.5 branch and will be part of the next release. We appreciate your effort! |
|
Thanks @wlfonseca! 🎉 The PR has been manually squashed and merged into release/v3.5.5 to avoid some heavy test conflicts! |



Summary
state: nulland normalizing empty/null state before token exchange