Enforce more lint rules.

This commit is contained in:
2020-11-01 20:54:26 -06:00
parent 33aaddad9c
commit b758b85b15
6 changed files with 40 additions and 14 deletions

View File

@@ -43,10 +43,14 @@ const register = async (req, res, next) => {
* @param {*} res
* @param {*} next
*/
const login = async (req, res) => {
const login = async (req, res, next) => {
let user;
try { user = await users.getByEmail(req.body.email); }
catch (error) { return done(error, null); }
try {
user = await users.getByEmail(req.body.email);
} catch (error) {
console.log(error);
return next(error, null);
}
if (!user) {
return res.status(404).send({ error: `Authentication failed. User not found.` });