AOSSIE-Org / AOSSIE-Org/DebateAI

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

Aperta Adatta ai principianti
#470 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
TypeScript
Stelle
84
Fork
198
Merge medio
2g 19h
PR unite (30g)
30

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
go, react, typescript, vite
Ambito
api, authentication, backend, frontend
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
72/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.