AOSSIE-Org / AOSSIE-Org/DebateAI

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

オープン
#509 コメント 2 件 リアクション 0 件 担当者 1 名 @Shreyas-Gowda26 が担当を希望しています GitHub で見る
bug
主要言語
TypeScript
スター
84
フォーク
198
平均マージ
2日 19時間
マージ済み PR(30日)
30

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。