Skip to content

fix: improve login form validation with sequential checks #312#379

Open
eshwar210607 wants to merge 2 commits into
c2siorg:developfrom
eshwar210607:fix/login-validation
Open

fix: improve login form validation with sequential checks #312#379
eshwar210607 wants to merge 2 commits into
c2siorg:developfrom
eshwar210607:fix/login-validation

Conversation

@eshwar210607
Copy link
Copy Markdown

📝 Description
This PR improves the user experience of the login form by implementing sequential validation.

🛠️ Changes:
Refactored Validation Logic: Replaced the previous bitwise AND operator with step-by-step conditional checks.

Early Returns: Added early returns to ensure that only one validation error is displayed at a time.

Validation Order: The form now validates the Email first. Password validation is only triggered once a valid email format is provided.

🌟 Why this is better:
Previously, multiple validation errors could appear simultaneously or in a confusing order. Now, the user receives clear, one-at-a-time feedback, making the login process more intuitive and less overwhelming for the user.

🔗 Related Issues
Fixes #312

📷 Screenshots
Email Validation (Shows first):
Screenshot 2026-03-31 212401

Password Validation (Shows only after email is valid):
Screenshot 2026-03-31 212430

✅ Checklist
[x] My code follows the style guidelines of this project.

[x] I have performed a self-review of my own code.

[x] Only the necessary files (src/components/AuthPage/Login/index.jsx) are included in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug Report: Bitwise Operator Used Instead of Logical Operator in Login Validation

1 participant