The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/server/routes/avatar/middlewares/auth.js

15 lines
326 B

import { Meteor } from 'meteor/meteor';
import { userCanAccessAvatar } from '../utils';
// protect all avatar endpoints
export const protectAvatars = Meteor.bindEnvironment((req, res, next) => {
if (!userCanAccessAvatar(req)) {
res.writeHead(403);
res.write('Forbidden');
res.end();
return;
}
return next();
});