Skip to content

Registration form schema is inconsistent with backend API validation #227

Description

@Jaykolate

Description

The frontend registration form schema does not match the backend registration API contract. Although the current frontend may still use mock services, switching to the real backend API will cause registration requests to fail due to validation mismatches.

The inconsistencies include:

The frontend uses firstName and lastName (camelCase), while the backend expects first_name and last_name (snake_case).
The backend requires a username field, but the frontend registration form does not collect or send one.
The frontend accepts passwords with a minimum length of 6 characters, while the backend requires a minimum of 8 characters.
Steps to Reproduce
Open the registration page.
Fill out the signup form using valid frontend inputs.
Submit the registration request to the backend API.
Observe the backend validation response.
Actual Behavior

The backend rejects the request with validation errors such as:

first_name field required
last_name field required
username field required
Password must be at least 8 characters
Expected Behavior

The frontend and backend should use a consistent registration schema so that valid frontend submissions are accepted by the backend without validation errors.

Suggested Fix
Add a username field to the frontend registration form and validation schema.
Align request field names by either:
sending first_name and last_name, or
mapping firstName/lastName to the backend field names before making the API request.
Update the frontend password validation to require a minimum of 8 characters (or align the backend requirement if a different policy is preferred).
Impact

Once the frontend is connected to the real backend API, registration requests will consistently fail due to schema mismatches, preventing new users from creating accounts successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions