AOSSIE-Org / AOSSIE-Org/DebateAI

Fix authentication form validation and incorrect error handling

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

描述

Problem:
The authentication forms (login & signup) currently show incorrect and confusing error behavior:
- Generic "Failed to fetch" / "Unexpected error occurred" messages appear for client-side validation cases.
- Duplicate error messages are rendered in some cases.
- Password input becomes blocked or unresponsive when email validation fails.
- Backend/network errors and client-side validation errors are mixed together.
- Some validations trigger too early and prevent normal typing.

This results in poor UX and makes it difficult for users to understand what went wrong.

Expected Behavior
- Users should always be able to freely type email and password.
- Validation should only occur on form submission.
- Clear, specific client-side error messages should be shown for:
- Empty email
- Empty password
- Short password
- Password mismatch (signup)
- Backend errors should be displayed separately.
- No duplicate or stale error messages should persist.

Proposed Fix
- Separate client-side validation errors from backend errors.
- Run validation only on submit (not on change).
- Remove blocking validations that prevent typing.
- Show only one error message at a time.
- Clean unused variables and lint issues.

I’m working on a fix and would like to submit a PR for this.

贡献指南

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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