-
Notifications
You must be signed in to change notification settings - Fork 560
Open
Description
Bug
In app/modules/auth/auth_router.py, the POST /signup and POST /auth/custom-token endpoints use Response(content=json.dumps(...)) to return JSON data. The Response class defaults to Content-Type: text/plain, so clients that check the content-type header will not parse the body as JSON.
# Current (broken — Content-Type: text/plain):
return Response(content=json.dumps({"error": "Missing uid"}), status_code=400)
# Should be (Content-Type: application/json):
return JSONResponse(content={"error": "Missing uid"}, status_code=400)18 instances across the signup handler and custom-token handler are affected. Meanwhile, other routes in the same file (login, SSO login, provider endpoints) correctly use JSONResponse.
Impact
- API clients and frontend code that checks the
Content-Typeheader will not parse signup/custom-token responses as JSON - Inconsistent response format within the same router — login returns
application/jsonbut signup returnstext/plainfor equivalent JSON bodies
Expected behavior
All endpoints returning JSON data should use JSONResponse (or set media_type="application/json") so the Content-Type header is correct.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels