Improve centralized error handling
This commit is contained in:
@@ -48,12 +48,6 @@ export const authenticate = async (req, res, next) => {
|
||||
});
|
||||
}
|
||||
|
||||
return res.status(401).json({
|
||||
success: false,
|
||||
error: {
|
||||
message: 'Neplatný alebo expirovaný token',
|
||||
statusCode: 401,
|
||||
},
|
||||
});
|
||||
return next(error);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user