Files
Palmr/apps/server/src/modules/user/middleware.ts
Daniel Luiz Alves 75d6049b87 feat: enhance pre-push validation and update ESLint configurations
- Updated the Husky pre-push hook to validate all applications (web, docs, and server) before pushing changes, improving code quality checks.
- Modified ESLint configurations for the docs app to include additional ignored directories, ensuring cleaner linting results.
- Refactored the HomePage component in the docs app to improve structure and readability, while reintroducing the Highlight component for better content presentation.
- Added a .prettierignore file in the server app to exclude specific directories from formatting, enhancing development workflow.
- Updated various import statements across multiple files for consistency and clarity.
2025-07-02 14:53:23 -03:00

19 lines
560 B
TypeScript

import { FastifyReply, FastifyRequest } from "fastify";
import { ConfigService } from "../config/service";
const configService = new ConfigService();
export async function validatePasswordMiddleware(request: FastifyRequest, reply: FastifyReply) {
const body = request.body as any;
if (!body.password) return;
const minLength = Number(await configService.getValue("passwordMinLength"));
if (body.password.length < minLength) {
return reply.status(400).send({
error: `Password must be at least ${minLength} characters long`,
});
}
}