AOSSIE-Org / AOSSIE-Org/DebateAI

[BUG]: Authentication errors are not displayed correctly due to inconsistent response fields

Open Beginner friendly
#470 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
84
Forks
198
Avg merge
2d 19h
Merged PRs (30d)
30

Description

### 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

Image

### 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

Contributor guide

No contributing guide indexed for this repository

Research direction

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.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, react, typescript, vite
Domain
api, authentication, backend, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.