-
Notifications
You must be signed in to change notification settings - Fork 244
Open
Description
Enhancement Request: Add express-validator
📌 Description
Currently, input fields (username, bio, social links) do not have strict validation. This can allow invalid or insecure data into the database. We will use express-validator to enforce input rules.
🛠 Middleware
- express-validator
🚀 Implementation
- Install:
npm install express-validator
- Add validation rules in controllers:
import { body, validationResult } from "express-validator";
body("username").isLength({ min: 3 })
body("bio").isLength({ max: 150 })
body("social_links.website").optional().isURL()
- Return errors if validation fails using
validationResult
.
✅ Expected Outcome
- Ensure valid usernames, bios, and links.
- Block invalid or unsafe data from being saved.
Metadata
Metadata
Assignees
Type
Projects
Status
assigned