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({
|
||||
message: 'Auth successful',
|
||||
donor: users[0],
|
||||
user: users[0],
|
||||
token
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ module.exports = role => (req, res, next) => {
|
||||
next();
|
||||
} catch (error) {
|
||||
error.message = 'Check Auth Error';
|
||||
error.status = 401;
|
||||
error.status = 403;
|
||||
return next(error);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user