AOSSIE-Org / AOSSIE-Org/DebateAI

Issue: Persistent Error Notification in Auth Flow

Open
#214 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
84
Forks
198
Avg merge
2d 19h
Merged PRs (30d)
30

Description

**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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.