Skip to content

Commit 46b0c76

Browse files
authored
Merge pull request #99 from fac-14/martins
martin login solution
2 parents bcb78e9 + 715f86f commit 46b0c76

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/dbQueries.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,14 @@ const dbQuery = {
5151
console.log('errorrrrrr')
5252
} else {
5353
comparePasswords(password, res.rows[0].pass)
54-
.then(res => {
55-
cb(null, res);
54+
.then(res => {
55+
if (!res) {
56+
cb("Error", null);
57+
} else {
58+
cb(null, res);
59+
}
5660
})
57-
.catch(console.log);
61+
.catch(cb("Error", null));
5862
}
5963
});
6064
},

0 commit comments

Comments
 (0)