AOSSIE-Org / AOSSIE-Org/DebateAI

Auth endpoints (/signup, /login) return empty responses instead of JSON on error

Đang mở
#243 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
84
Fork
198
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
30

Mô tả

🐞 Problem
Both `/signup` and `/login` endpoints sometimes return an empty response body instead of a JSON response when an error occurs.

This causes the frontend to fail with the following error:

Failed to execute 'json' on 'Response': Unexpected end of JSON input

Image

Expected Behavior

The backend should always return a valid JSON response (success or error) for auth endpoints,

Actual Behavior

On certain error paths (e.g. validation failure, user already exists, password mismatch, JWT/bcrypt error), the handler exits without calling c.JSON(...), resulting in an empty response body.

Impact

Frontend crashes during signup/login

New users cannot complete authentication

Poor developer onboarding experience for local setup

Steps to Reproduce

Run backend and frontend locally as per README

Attempt signup or login

Observe frontend error: Unexpected end of JSON input

I have reproduced this issue locally and would like to work on fixing it. Please let me know if I can proceed and submit a PR.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.