forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfieldRequirements.js
More file actions
28 lines (27 loc) · 860 Bytes
/
fieldRequirements.js
File metadata and controls
28 lines (27 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { ref } from 'yup'
import { t } from '@lingui/macro'
export const fieldRequirements = {
email: {
required: { message: t`Email cannot be empty` },
email: { message: t`Invalid email` },
},
displayName: { required: { message: t`Display name cannot be empty` } },
password: {
required: { message: t`Password cannot be empty` },
min: {
minLength: 12,
message: t`Password must be at least 12 characters long`,
},
},
confirmPassword: {
required: { message: t`Password confirmation cannot be empty` },
oneOf: { types: [ref('password')], message: t`Passwords must match` },
},
lang: {
required: { message: t`Please choose your preferred language` },
oneOf: { types: ['ENGLISH', 'FRENCH'], message: '' },
},
domainUrl: {
required: { message: t`Domain url field must not be empty` },
},
}