Skip to content

Commit e54db6c

Browse files
committed
bug(users): Fix email duplication
- normalizes email upon signup [Delivers #167975800]
1 parent 7c63683 commit e54db6c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/server/middlewares/validateBody.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
const Joi = require('joi');
22

33
module.exports = (req, res, next, schema) => {
4+
if (req.body.email) {
5+
const email = req.body.email;
6+
req.body.email = email.toLowerCase();
7+
}
48
Joi.validate(req.body, schema, error => {
59
if (error) {
610
return res.status(400).send({ message: error.details[0].message });

0 commit comments

Comments
 (0)