code: function (req, res, next) {
      var accessTokenUrl = 'https://graph.facebook.com/oauth/access_token';
      var params = {
        code: req.body.code,
        client_id: req.body.clientId,
        client_secret: config.FACEBOOK_SECRET,
        redirect_uri: req.body.redirectUri
      };
  
      request.get({ url: accessTokenUrl, qs: params, json: true }, function(err, response, accessToken) {
        if (response.statusCode !== 200) {
          res.status(500).send({ message: accessToken.error.message });
          return;
        }
        req.accessToken = qs.parse(accessToken);
        next();
      });
    }
docs: Step 1. Exchange authorization code for access token.