Format
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
var UserModel = require('../models/userModel');
|
||||
|
||||
async function checkAuthenticated(req, res, next) {
|
||||
try{
|
||||
try {
|
||||
const password = req.body.pass;
|
||||
const userFound = await UserModel.findOne({ pass: password });
|
||||
if (!userFound) {
|
||||
@@ -10,7 +10,7 @@ async function checkAuthenticated(req, res, next) {
|
||||
}
|
||||
req.user = userFound;
|
||||
return next();
|
||||
}catch (err) {
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
return res.status(500).json({ message: 'Error when getting transactions.' });
|
||||
}
|
||||
|
Reference in New Issue
Block a user