Enforce more lint rules.
This commit is contained in:
@@ -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.` });
|
||||
|
||||
Reference in New Issue
Block a user