AOSSIE-Org / AOSSIE-Org/DebateAI

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

Offen Anfängerfreundlich
#470 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
TypeScript
Sterne
84
Forks
198
Ø Merge
2 T. 19 Std.
Gemergte PRs (30 T.)
30

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
go, react, typescript, vite
Bereich
api, authentication, backend, frontend
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
72/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.