File size: 586 Bytes
f8b5d42 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
/**
* A simple middleware that validates that the chat history is viewable.
* via the `DISABLE_VIEW_CHAT_HISTORY` environment variable being set AT ALL.
* @param {Request} request - The request object.
* @param {Response} response - The response object.
* @param {NextFunction} next - The next function.
*/
function chatHistoryViewable(_request, response, next) {
if ("DISABLE_VIEW_CHAT_HISTORY" in process.env)
return response
.status(422)
.send("This feature has been disabled by the administrator.");
next();
}
module.exports = {
chatHistoryViewable,
};
|