소스 검색

:sparkles: Got email validation working properly

tabs-content
tomit4 3 년 전
부모
커밋
39d4635d21
2개의 변경된 파일1488개의 추가작업 그리고 1개의 파일을 삭제
  1. 2
    1
      frontend/src/entities/survey/survey.answer.validator.js
  2. 1486
    0
      frontend/src/entities/survey/tlds-alpha-by-domain.js

+ 2
- 1
frontend/src/entities/survey/survey.answer.validator.js 파일 보기

@@ -1,8 +1,9 @@
1 1
 import Joi from 'joi'
2
+import domains from './tlds-alpha-by-domain.js' 
2 3
 
3 4
 const answerValidator = {
4 5
     name: Joi.string().required(),
5
-    email: Joi.string().email({ minDomainSegments: 2, tlds: false }),
6
+    email: Joi.string().email({ minDomainSegments: 2, tlds: { allow: domains }}),
6 7
     // TODO: Refine password regex to have more secure requirements
7 8
     password: Joi.string().min(10).max(30).pattern(new RegExp('[a-zA-Z0-9]+')),
8 9
     // TODO: Change if going international (only works in usa)

+ 1486
- 0
frontend/src/entities/survey/tlds-alpha-by-domain.js
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


Loading…
취소
저장