[API] - Fix invalid characters error when registering. Closes #41

This commit is contained in:
Jonathan Barrow
2023-07-13 14:17:21 -04:00
parent 648e15c9e1
commit ee9c1f7821

View File

@@ -19,10 +19,10 @@ import { HydratedPNIDDocument } from '@/types/mongoose/pnid';
const router: express.Router = express.Router();
const PNID_VALID_CHARACTERS_REGEX: RegExp = /^[\w\-.]*$/gm;
const PNID_PUNCTUATION_START_REGEX: RegExp = /^[_\-.]/gm;
const PNID_PUNCTUATION_END_REGEX: RegExp = /[_\-.]$/gm;
const PNID_PUNCTUATION_DUPLICATE_REGEX: RegExp = /[_\-.]{2,}/gm;
const PNID_VALID_CHARACTERS_REGEX: RegExp = /^[\w\-.]*$/;
const PNID_PUNCTUATION_START_REGEX: RegExp = /^[_\-.]/;
const PNID_PUNCTUATION_END_REGEX: RegExp = /[_\-.]$/;
const PNID_PUNCTUATION_DUPLICATE_REGEX: RegExp = /[_\-.]{2,}/;
// This sucks
const PASSWORD_WORD_OR_NUMBER_REGEX: RegExp = /(?=.*[a-zA-Z])(?=.*\d).*/;