Add backend validation to check for lowercase
This commit is contained in:
1 parent
ee22216bf9
commit
73136545cc
2 files changed
+12
-1
No files matched your search
@@ -3,3 +3,4 @@
|
|||||||
mongo/data/*
|
mongo/data/*
|
||||||
redis/data/*
|
redis/data/*
|
||||||
*.env
|
*.env
|
||||||
|
certbot/*
|
||||||
@@ -35,7 +35,17 @@ const registerValidation = joi.object({
|
|||||||
.string()
|
.string()
|
||||||
.required()
|
.required()
|
||||||
.pattern(/^[A-Za-z]+$/),
|
.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
|
password: joi
|
||||||
.string()
|
.string()
|
||||||
.min(8)
|
.min(8)
|
||||||
|
|||||||
Reference in new issue
Block a user