Commit b0e90d89 authored by pdg16's avatar pdg16
Browse files

fiz /:id

parent e66b3132
Pipeline #19957 failed with stage
in 1 minute and 36 seconds
......@@ -119,17 +119,17 @@ userApp.get('/me', passport.authenticate('bearer', { session: false }), (req, re
next();
}, response('user'));
userApp.get('/:id', (req, res, next) => {
userApp.get('/:id', passport.authenticate('bearer', {session: false}), checkAdmin(), (req, res, next) => {
User.findById(req.params.id, (err, user) => {
if(err) {
log.error(err);
return next(err);
}
if(!user) {
if(!user || req.user.origin != user.origin) {
req.statusCode = 404;
next({msg: 'User not found'});
} else {
let u = user.toObject;
let u = user.toObject();
delete u.hashedPassword;
delete u.salt;
req.result = u;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment