Skip to content

[ENHANCEMENT] <Strengthen Registration Form Validation (Name & Gmail Restriction)> #1524

Description

@Aishu9Para

⚙️ Current Behavior

  • The Full Name field currently accepts numeric values (e.g., 12345), which should not be valid for a name input.
  • The Email field accepts any domain (e.g., username@anything.com) instead of restricting to @gmail.com.
  • Validation relies only on basic input types and does not strictly enforce business rules.
  • This may allow invalid or unintended data to be stored in the database.

🚀 Proposed Improvement

  • Implement strict validation rules:
    • Full Name → Allow only alphabets and spaces.
    • Email → Restrict domain strictly to @gmail.com.
  • Add validation on both frontend and backend to prevent bypassing via API tools.
  • Provide clear and user-friendly error messages when validation fails.

🔍 Why It’s Needed

  • Ensures clean and valid data in the database.
  • Maintains data integrity and consistency.
  • Prevents misuse or incorrect registrations.
  • Improves user experience with proper input feedback.
  • Enforces defined business requirements effectively.

🧩 Possible Implementation

  • Introduce stricter input validation rules for the registration form fields.
  • For the Full Name field, enforce a validation rule that allows only alphabetic characters and spaces. This can be implemented using pattern-based validation on the frontend and corresponding checks on the backend.
  • For the Email field, apply domain-level validation to restrict registrations to @gmail.com addresses only.
  • Implement validation at two levels:
    • Frontend validation to provide instant feedback and improve user experience.
    • Backend validation to ensure security and prevent bypassing client-side checks through API tools.
  • Display clear and user-friendly error messages when validation fails.
  • Optionally, add automated test cases to verify that invalid names and non-Gmail addresses are properly rejected.
  • Update documentation to reflect the new validation rules and expected input formats.

✅ Checklist

  • I’ve reviewed existing issues to ensure this isn’t a duplicate.
  • I’ve explained how this improves performance or readability.

Please add SWoC'25 label and proper difficulty label considering the issue!!

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions