changing to user and error code for forbidden
This commit is contained in:
@@ -37,7 +37,7 @@ exports.login = (type, role) => (req, res, next) => {
|
|||||||
);
|
);
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
message: 'Auth successful',
|
message: 'Auth successful',
|
||||||
donor: users[0],
|
user: users[0],
|
||||||
token
|
token
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ module.exports = role => (req, res, next) => {
|
|||||||
next();
|
next();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
error.message = 'Check Auth Error';
|
error.message = 'Check Auth Error';
|
||||||
error.status = 401;
|
error.status = 403;
|
||||||
return next(error);
|
return next(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user