|
|
@@ -7,16 +7,17 @@ const answerValidator = {
|
|
7
|
7
|
minDomainSegments: 2,
|
|
8
|
8
|
tlds: { allow: domains },
|
|
9
|
9
|
}),
|
|
10
|
|
- // TODO: password validation is a moving target with regex,
|
|
11
|
|
- // consider using a more robust library?
|
|
12
|
|
- password: Joi.string()
|
|
13
|
|
- .min(14)
|
|
14
|
|
- .max(30)
|
|
15
|
|
- .pattern(
|
|
16
|
|
- new RegExp(
|
|
17
|
|
- '^(?=.*[!@#$%^&*()_+\\-=[\\]{};\':"\\\\|,.<>\\/?])(?=.*[!@#$%^&*()_+\\-=[\\]{};\':"\\\\|,.<>\\/?])[a-zA-Z0-9!@#$%^&*()_+\\-=[\\]{};\':"\\\\|,.<>\\/?]{14,}$',
|
|
18
|
|
- ),
|
|
19
|
|
- ),
|
|
|
10
|
+ // Comment out and uncomment below for more robust password testing
|
|
|
11
|
+ password: Joi.string().min(14).max(30),
|
|
|
12
|
+ // TODO: consider using a more robust library for password validation
|
|
|
13
|
+ // password: Joi.string()
|
|
|
14
|
+ // .min(14)
|
|
|
15
|
+ // .max(30)
|
|
|
16
|
+ // .pattern(
|
|
|
17
|
+ // new RegExp(
|
|
|
18
|
+ // '^(?=.*[!@#$%^&*()_+\\-=[\\]{};\':"\\\\|,.<>\\/?])(?=.*[!@#$%^&*()_+\\-=[\\]{};\':"\\\\|,.<>\\/?])[a-zA-Z0-9!@#$%^&*()_+\\-=[\\]{};\':"\\\\|,.<>\\/?]{14,}$',
|
|
|
19
|
+ // ),
|
|
|
20
|
+ // ),
|
|
20
|
21
|
// TODO: Change if going international (only works in usa)
|
|
21
|
22
|
zipcode: Joi.string().min(5).max(5).pattern(new RegExp('^[0-9]{5}$')),
|
|
22
|
23
|
seeking: Joi.string(),
|