Fix loginToServer content type and missing grant_type#2821
Conversation
… multipart/form-data The FastAPI OAuth2PasswordRequestForm requires the request to be sent as application/x-www-form-urlencoded and also needs the grant_type field. This change replaces FormData with URLSearchParams in the loginToServer function and adds the missing grant_type: 'password' field. Co-authored-by: danielaskdd <36760595+danielaskdd@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
…failure - pass original refreshError as cause to Error constructor for better error tracing
- set 'Content-Type' to 'application/x-www-form-urlencoded' explicitly - ensure form data is correctly interpreted by the server on login
The login form was failing because it was sending credentials as
multipart/form-datawithout thegrant_typefield, which is required by the FastAPIOAuth2PasswordRequestForm. This PR fixes the issue by:URLSearchParamsto ensure the correctapplication/x-www-form-urlencodedcontent type is used.grant_type: 'password'to the request body.Content-Typeheader, allowing Axios/browser to set it automatically based on theURLSearchParamsdata.Fixes #2820
PR created automatically by Jules for task 1529585928018714723 started by @danielaskdd