AOSSIE-Org / AOSSIE-Org/DebateAI
[BUG]: Authentication errors are not displayed correctly due to inconsistent response fields
- 主要语言
- TypeScript
- 星标
- 84
- 派生
- 198
- 平均合并
- 2 天 19 小时
- 30 天内合并 PR
- 30
描述
### Bug Description
Several backend authentication failure responses return the error text using the error field:
{
"error": "Invalid email or password"
}
However, the frontend login function only reads data.message:
if (!response.ok) {
throw new Error(data.message || "Login failed");
}
As a result, users see the generic “Login failed” message instead of the specific backend error, such as:
- Invalid email or password
- Email not verified
- Invalid input
Error response handling should be consistent across authentication functions.
### Steps to Reproduce
Steps to Reproduce
1. Open the authentication page.
2. Enter an incorrect email or password.
3. Click Sign In With Email.
4. Observe the displayed error message.
5. The frontend shows “Login failed” instead of “Invalid email or password”.
6. The same problem occurs when attempting to log in with an unverified email.
### Logs and Screenshots
### Environment Details
- OS: Windows 11
- Frontend: React, TypeScript and Vite
- Backend: Go and Gin
- Browser: Chrome
- Deployment: Local/Docker
### Impact
Medium - Feature works but has issues
### Code of Conduct
- [x] I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- [x] I have searched existing issues to avoid duplicates
贡献指南
这个仓库没有索引到贡献指南
调研方向
Start at the frontend login function shown in the issue and trace the authentication functions that handle failed responses, then compare them with the backend authentication responses returning error. Verify the behavior with incorrect credentials and an unverified email; done means specific backend error text is displayed instead of the generic fallback.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- go, react, typescript, vite
- 领域
- api, authentication, backend, frontend
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 72/100