old_contents: var User = require('../models/user');
  var jwt = require('jsonwebtoken'); //used to create, sign and verify tokens
  var config = require('../config.js');
  //var Blog = require('../models/blog');
  //var Entry = require('../models/entry');
  //var Comment = require('../models/comment');
  //var Post = require('../models/post');
  
  exports.getToken = function(user) {
      return jwt.sign(user, config.secretKey, {
          expiresIn: 36000
      });
  };
  
  exports.verifyAdmin = function(req, res, next) {
      //check if verified ordinary user is an admin:
      var admin = req.decoded.admin;
      console.log("in verifyAdmin method");
      
      if(!admin) {
          var err = new Error('You are not authorized to perform this operation!');
          err.status = 403;
          return next(err);        
      } else {
          return next();
      }
  };
  
  exports.verifyOrdinaryUser = function(req, res, next) {
      //check header or url parameters or post parameters for token
      var token = req.body.token || req.query.token ||req.headers['x-access-token'];
      
      //decode token
      if(token) {
          //verifies secret and checks exp
          jwt.verify(token, config.secretKey, function(err, decoded) {
              if(err) {
                  var err = new Error('You are not authenticated!');
                  err.status = 401;
                  return next(err);
              } else {
                  //if everything is good, save to request for use in other routes:
                  req.decoded = decoded;
                  next();
              }
          });
      } else {
          //if there is no token return an error:
          var err = new Error('No token provided!');
          err.status = 403;
          return next(err);
      }
  };
new_contents: var User = require('../models/user');
  var jwt = require('jsonwebtoken'); //used to create, sign and verify tokens
  var config = require('../config.js');
  
  exports.getToken = function(user) {
      return jwt.sign(user, config.secretKey, {
          expiresIn: 36000
      });
  };
  
  exports.verifyAdmin = function(req, res, next) {
      //check if verified ordinary user is an admin:
      var admin = req.decoded.admin;
      console.log("in verifyAdmin method");
      
      if(!admin) {
          var err = new Error('You are not authorized to perform this operation!');
          err.status = 403;
          return next(err);        
      } else {
          return next();
      }
  };
  
  exports.verifyOrdinaryUser = function(req, res, next) {
      //check header or url parameters or post parameters for token
      var token = req.body.token || req.query.token ||req.headers['x-access-token'];
      
      //decode token
      if(token) {
          //verifies secret and checks exp
          jwt.verify(token, config.secretKey, function(err, decoded) {
              if(err) {
                  var err = new Error('You are not authenticated!');
                  err.status = 401;
                  return next(err);
              } else {
                  //if everything is good, save to request for use in other routes:
                  req.decoded = decoded;
                  next();
              }
          });
      } else {
          //if there is no token return an error:
          var err = new Error('No token provided!');
          err.status = 403;
          return next(err);
      }
  };
subject: remove unused require statements