feat(Sign-up)-using zod
✨ Feature Request
Summary:
Implement Zod-based validation for the Signup Form to ensure clean, accurate, and secure user data during account creation.
Problem Statement:
The current signup flow allows users to enter invalid or poorly formatted data, such as:
- Names with leading/trailing spaces
- Invalid or short phone numbers
- Weak or improperly formatted passwords
- Empty or partially filled fields
- Email formats not strictly validated
This results in inconsistent user records, authentication issues, and manual corrections by admins.
Proposed Solution:
Introduce Zod schema validation in the signup component to enforce strict and meaningful checks, including:
🔹 1. Name Validation
- Trim spaces before/after input
- Ensure minimum length: e.g., 3 characters
- Restrict numeric or special-character–only names
- Allow alphabetic names with spaces
🔹 2. Phone Number Validation
- Must be exactly 10 digits
- Auto-prefix
+91or validate existing prefixes - Reject characters, spaces, or partial numbers
- Remove accidental whitespace before validation
🔹 3. Email Validation
- Use Zod’s strict email validation
- Prevent uppercase-only or malformed addresses
🔹 4. Password Validation
- Minimum 6–8 characters
- Must include letters and numbers
- Prevent passwords with only spaces or repeated characters
🔹 5. Confirm Password
- Must match password exactly
🔹 6. General Improvements
- Show inline error messages below each field
- Disable signup button until all fields are valid
- Highlight invalid fields in red
- Provide real-time validation feedback
Alternatives Considered:
- Using simple HTML validation → rej