checking password length during signup
This commit is contained in:
@@ -17,6 +17,8 @@ exports.createDonor = (req, res, next) => {
|
||||
if (donors.length >= 1) {
|
||||
return next(errorMaker(409, `Email Exists: ${req.body.email}`));
|
||||
} else {
|
||||
if (req.body.password.length < 6)
|
||||
return next(errorMaker(400, 'Password requirements not met!'));
|
||||
// hash and store
|
||||
bcrypt.hash(req.body.password, null, null, function(error, hash) {
|
||||
// Store hash in your password DB.
|
||||
|
||||
@@ -107,6 +107,9 @@ exports.createOrganization = async (req, res, next) => {
|
||||
try {
|
||||
transaction = await db.sequelize.transaction();
|
||||
|
||||
if (password.length < 6)
|
||||
return next(errorMaker(400, 'Password requirements not met!'));
|
||||
|
||||
const orgs = await Organization.findAll({
|
||||
where: { primary_contact_email }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user