浏览代码

:pencil2: A bit of cleaning up before merge

tags/0.0.3^2
tomit4 3 年前
父节点
当前提交
564103169f
共有 2 个文件被更改,包括 11 次插入12 次删除
  1. 11
    10
      frontend/src/entities/survey/survey.answer.validator.js
  2. 0
    2
      frontend/src/utils/survey.js

+ 11
- 10
frontend/src/entities/survey/survey.answer.validator.js 查看文件

7
         minDomainSegments: 2,
7
         minDomainSegments: 2,
8
         tlds: { allow: domains },
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
     // TODO: Change if going international (only works in usa)
21
     // TODO: Change if going international (only works in usa)
21
     zipcode: Joi.string().min(5).max(5).pattern(new RegExp('^[0-9]{5}$')),
22
     zipcode: Joi.string().min(5).max(5).pattern(new RegExp('^[0-9]{5}$')),
22
     seeking: Joi.string(),
23
     seeking: Joi.string(),

+ 0
- 2
frontend/src/utils/survey.js 查看文件

7
         this.questionsFromDb = []
7
         this.questionsFromDb = []
8
     }
8
     }
9
     _addResponses(responseKeys, possibleResponsesByCategory) {
9
     _addResponses(responseKeys, possibleResponsesByCategory) {
10
-        console.log('possibleResponsesByCategory >>', possibleResponsesByCategory)
11
         Object.keys(possibleResponsesByCategory).forEach(categoryKey => {
10
         Object.keys(possibleResponsesByCategory).forEach(categoryKey => {
12
-            console.log('categoryKey >>', categoryKey)
13
             responseKeys.forEach(responseKey => {
11
             responseKeys.forEach(responseKey => {
14
                 if (possibleResponsesByCategory[categoryKey].length) {
12
                 if (possibleResponsesByCategory[categoryKey].length) {
15
                     responseKey.responses = possibleResponsesByCategory[categoryKey]
13
                     responseKey.responses = possibleResponsesByCategory[categoryKey]

正在加载...
取消
保存