auth fixed
This commit is contained in:
parent
546ee6ac3e
commit
ce19f6c5c6
@ -27,12 +27,12 @@ export const isAuthenticatedUser = async (req, res, next) => {
|
||||
// console.log(frontdecoded);
|
||||
const fuser = await User.findById(frontdecoded.id);
|
||||
// console.log(fuser);
|
||||
// if (!fuser) {
|
||||
// return res.status(404).json({
|
||||
// success: false,
|
||||
// message: "User not found",
|
||||
// });
|
||||
// }
|
||||
if (!fuser) {
|
||||
return res.status(404).json({
|
||||
success: false,
|
||||
message: "User not found",
|
||||
});
|
||||
}
|
||||
req.user = fuser;
|
||||
|
||||
next();
|
||||
|
Loading…
Reference in New Issue
Block a user