Skip to content

Commit c834e46

Browse files
committed
fix bug with pg driver email uniqueness validation
1 parent 9d4be3c commit c834e46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/users/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const USER_COLLECTION_NAME = exports.USER_COLLECTION_NAME = 'user';
1515
exports.JWT_SECRET_KEY = process.env.JWT_SECRET_KEY || 'efwpoeiurpoijk123`3asd;lkj32E@#;l3kj3#Eeplk3j34fpoiu-Oiu;lkj';
1616

1717
exports.validateEmailUniqueness = async (req, email, errors) => {
18-
if (email && errors.email === undefined && (await req.wrestler.dbDriver.countBy(req.wrestler.resource, { email })) !== 0) {
18+
if (email && errors.email === undefined && +(await req.wrestler.dbDriver.countBy(req.wrestler.resource, { email })) !== 0) {
1919
errors.email = { messages: ['Email already exists'] };
2020
}
2121
};

0 commit comments

Comments
 (0)