AOSSIE-Org / AOSSIE-Org/DebateAI

Issue: Persistent Error Notification in Auth Flow

未关闭
#214 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
84
派生
198
平均合并
2 天 19 小时
30 天内合并 PR
30

描述

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

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。