full-stack-fastapi-template icon indicating copy to clipboard operation
full-stack-fastapi-template copied to clipboard

Fix loginAccessToken Prop in useAuth.ts to Resolve 400 Error on dashboard login

Open gregorvolkmann opened this issue 7 months ago • 0 comments

This pull request fixes an HTTP 400 error in production by updating the login function in frontend/src/hooks/useAuth.ts. The LoginService.loginAccessToken call was incorrectly passing { formData: data } instead of { formData: { data.username, data.password } }, causing a type mismatch and sending multipart/form-data instead of application/x-www-form-urlencoded. The change ensures compliance with the LoginLoginAccessTokenData type and corrects the login request format.

gregorvolkmann avatar Jun 21 '25 18:06 gregorvolkmann