Add backend validation to check for lowercase
This commit is contained in:
1 parent
ee22216bf9
commit
73136545cc
2 files changed
+13
-2
No files matched your search
+2
-1
@@ -2,4 +2,5 @@
|
||||
!build_images.sh
|
||||
mongo/data/*
|
||||
redis/data/*
|
||||
*.env
|
||||
*.env
|
||||
certbot/*
|
||||
@@ -35,7 +35,17 @@ const registerValidation = joi.object({
|
||||
.string()
|
||||
.required()
|
||||
.pattern(/^[A-Za-z]+$/),
|
||||
email: joi.string().email().required(),
|
||||
email: joi
|
||||
.string()
|
||||
.email()
|
||||
.required()
|
||||
.custom((value, helpers) => {
|
||||
const lowercasedValue = value.toLowerCase();
|
||||
if (value !== lowercasedValue) {
|
||||
return helpers.message("Email must be in lowercase");
|
||||
}
|
||||
return lowercasedValue;
|
||||
}),
|
||||
password: joi
|
||||
.string()
|
||||
.min(8)
|
||||
|
||||
Reference in new issue
Block a user