Skip to content

Add request validation middleware for auth routes #9

Description

@Aryan3522

Implement request validation middleware for the authentication routes (/register and /login) to ensure incoming request bodies are properly validated before reaching the controllers.

What Needs to Be Done:

Add a validation library (e.g., Joi or Zod).

Create reusable validation middleware.

Validate required fields:

Register: email (valid format), password (minimum length).

Login: email and password.

Return a structured 400 Bad Request response for invalid input.

Ensure no changes break existing authentication flow.

The goal is to move validation logic out of controllers and enforce clean, production-safe input handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions