AOSSIE-Org / AOSSIE-Org/DebateAI

Issue: Persistent Error Notification in Auth Flow

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

Descrizione

**Description**
The authentication error notification (e.g., "Login failed") persists in the UI even after the user has switched context. For example, if a user fails to log in and then navigates to the Sign Up or OTP Verification screens, the red "Login failed" error message remains visible. This creates a confusing user experience, as the error state does not reflect the current active form.

Image

**Proposed Changes**

#### 1. Global State Management (`authContext.tsx`)
* **Expose Reset Action:** Add a `clearError` function to the `AuthContext` interface and provider.
* *Goal:* Provide a centralized way for components to reset the global `error` string to `null` without triggering a full page reload or logout.

#### 2. Component Logic (`Authentication.tsx`)
* **Trigger Reset on Navigation:** Update the `toggleAuthMode`, `startOtpVerification`, and `startForgotPassword` handlers to invoke `clearError()` immediately before changing the `authMode` state.
* *Goal:* Ensure that every time the user transitions to a new authentication phase (Login → Signup → OTP), the UI starts with a clean slate, automatically removing stale error messages from previous attempts.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.