Initial commit in this repository

This commit is contained in:
Rapturate
2026-04-27 22:16:17 -04:00
commit 68e7058ca4
64 changed files with 20817 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import { body } from 'express-validator';
import { handleValidationErrors } from './handleValidationErrors.js';
export const validateSignUp = [
body('username')
.exists({ checkFalsy: true })
.withMessage('Username is required')
.bail()
.trim()
.escape()
.isLength({ min: 3 })
.withMessage('Username must be at least 3 characters'),
body('password')
.exists({ checkFalsy: true })
.withMessage('Password is required')
.bail()
.isLength({ min: 8 })
.withMessage('Password must be at least 8 characters'),
handleValidationErrors,
];
export const validateLogIn = [
body('username')
.exists({ checkFalsy: true })
.withMessage('Username is required'),
body('password')
.exists({ checkFalsy: true })
.withMessage('Password is required'),
handleValidationErrors,
];