index.js
function (req, res, next) {
    var profileUrl = 'https://api.foursquare.com/v2/users/self';
    var params = {
      v: '20140806',
      oauth_token: req.accessToken
    };

    request.get({ url: profileUrl, qs: params, json: true }, function(err, response, profile) {
      if (err) {
        res.status(500).send(err);
        return;
      }
      req.profile = profile.response.user;
      next();
    });
  }
function (req, res, next) {
    var profileUrl = 'https://api.foursquare.com/v2/users/self';
    var params = {
      v: '20140806',
      oauth_token: req.accessToken
    };

    request.get({ url: profileUrl, qs: params, json: true }, function(err, response, profile) {
      if (err) {
        res.status(500).send(err);
        return;
      }
      req.profile = profile.response.user;
      next();
    });
  }
function ( req , res , next ) { var profileUrl = 'https://api.foursquare.com/v2/users/self' ; var params = { v : '20140806' , oauth_token : req . accessToken } ; request . get ( { url : profileUrl , qs : params , json : true } , function ( err , response , profile ) { if ( err ) { res . status ( 500 ) . send ( err ) ; return ; } req . profile = profile . response . user ; next ( ) ; } ) ; }
Step 2. Retrieve information about the current user.
Step 2 . Retrieve information about the current user .