mirror of
https://github.com/kyantech/Palmr.git
synced 2025-10-22 22:02:00 +00:00
- 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.
19 lines
560 B
TypeScript
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`,
|
|
});
|
|
}
|
|
}
|