AOSSIE-Org / AOSSIE-Org/DebateAI

[BUG]: No way to verify email if the initial signup verification screen is missed or closed

Abierto
#509 2 comentarios 0 reacciones 1 asignado Reclamado por @Shreyas-Gowda26 Ver en GitHub
bug
Lenguaje dominante
TypeScript
Estrellas
84
Forks
198
Merge medio
2 d 19 h
PR fusionados (30 d)
30

Descripción

### Bug Description

After signing up, the "Verify Your Email" OTP screen only appears as a temporary UI state on the /auth page immediately following a successful signup call — it is not a real route (the URL stays at /auth throughout). If the user closes the tab, refreshes, or simply comes back later and tries to log in instead of signing up again, there is no way to reach that OTP screen again.

Attempting to log in with an unverified account just returns a generic "Login failed" (backend returns {"error": "Email not verified"}, but the frontend doesn't display this specific reason, or link anywhere to verify). Attempting to sign up again with the same email fails with "User already exists", since the account was already created on the first attempt.

This leaves the user permanently stuck: the account exists, is unverified, and there is no self-service path to ever verify it.

Note: this is distinct from #496 (orphaned user on failed email send) — in this case the email sends successfully and the OTP is delivered, but there is no persistent UI path to enter it once the initial ephemeral screen is missed.

### Steps to Reproduce

1. Go to /auth, sign up with a new email + password.
2. The "Verify Your Email" OTP panel appears (still on the /auth URL).
3. Instead of entering the OTP, close the tab or refresh the page.
4. Go back to /auth and try to log in with the same credentials.
5. Observe: "Login failed" (backend says "Email not verified", not shown to the user), and no visible way to re-enter the OTP or resend it.
6. Try signing up again with the same email — observe "User already exists". The account is now stuck with no path to verification.

### Logs and Screenshots

Image

Login response (Network tab): {"error": "Email not verified"}
Frontend shows only: "Login failed"

Image

Image

No route exists for the verification screen — URL stays at /auth throughout the entire signup → verify flow (confirmed via DevTools Network tab and address bar).

### Environment Details

File: frontend/src/Pages/Authentication/forms.tsx (OTP component), frontend/src/context/authContext.tsx (signup/login/verifyEmail handlers)
Backend: /login route correctly returns {"error": "Email not verified"}
Frontend: Vite + React
Branch: main
Suggested fix: either (a) give the OTP screen its own persistent route so it's directly revisitable, or (b) have the login flow detect the "Email not verified" error and route the user back into the OTP-entry component (ideally resending a fresh code, since the original may have expired by the time the user returns).

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.