var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');

var bodyParser = require('body-parser');var express = require('express');
var router = express.Router();

var mongoose = require('mongoose');
var jwt = require('jsonwebtoken');
var config = require('../config.js');
var User = require('../models/user.js');

/* GET users listing. */
router.get('/', function(req, res, next) {
    User.find({}, function(err, users) {
        res.json(users);
    })
     //res.send('respond with a resource');
});

module.exports = router;

@@ -430,16 +430,648 @@
 .js');%0A%0A
+router.use(function(req, res, next) %7B%0A    var token = req.body.token %7C%7C req.query.token %7C%7C req.headers%5B'x-access-token'%5D;%0A%0A    if(token) %7B%0A        jwt.verify(token, 'supersecret', function(err, decoded) %7B%0A            if(err) %7B%0A                return res.json(%7B%0A                    success: false,%0A                    message: 'Failed to authenticate'%0A                %7D);%0A            %7D else %7B%0A                req.decoded = decoded;%0A                next();%0A            %7D%0A        %7D);%0A    %7D else %7B%0A        return res.status(403).send(%7B%0A                success: false,%0A                message: 'No token provided'%0A        %7D);%0A    %7D%0A%7D);%0A%0A
 /* GET u
@@ -1200,57 +1200,14 @@
 s);%0A
+
     %7D)
-%0A     //res.send('respond with a resource')
 ;%0A%7D)

Add authentication to the users file