title: Passport Error - Strategy.ParseErrorResponse
body: <p>Hi there I've been trying to find a solution for this error for 2 days and to no avail! I have already searched on Stack Overflow. The errors are simply not related to mine. Here is the stack trace I am receiving.</p>
  
  <pre><code>Error
      at Strategy.parseErrorResponse (/Users/jeremy/projects/thinkful_capstone_2/node_modules/passport-facebook/lib/strategy.js:196:12)
      at Strategy.OAuth2Strategy._createOAuthError (/Users/jeremy/projects/thinkful_capstone_2/node_modules/passport-oauth2/lib/strategy.js:376:16)
      at /Users/jeremy/projects/thinkful_capstone_2/node_modules/passport-oauth2/lib/strategy.js:166:45
      at /Users/jeremy/projects/thinkful_capstone_2/node_modules/oauth/lib/oauth2.js:191:18
      at passBackControl (/Users/jeremy/projects/thinkful_capstone_2/node_modules/oauth/lib/oauth2.js:132:9)
      at IncomingMessage.&lt;anonymous&gt; (/Users/jeremy/projects/thinkful_capstone_2/node_modules/oauth/lib/oauth2.js:157:7)
      at emitNone (events.js:91:20)
      at IncomingMessage.emit (events.js:188:7)
      at endReadableNT (_stream_readable.js:975:12)
      at _combinedTickCallback (internal/process/next_tick.js:80:11)
      at process._tickCallback (internal/process/next_tick.js:104:9)
  </code></pre>
  
  <p>also here is my code:</p>
  
  <pre><code>const path = require('path');
  // const Strategy = require('passport-facebook').Strategy;
  const bodyParser = require('body-parser');
  const passport = require('passport');
  // const { User } = require('../models/usermodel.js');
  const express = require('express');
  const cookieParser = require('cookie-parser');
  const router = express.Router();
  const app = express();
  
  app.use(passport.initialize());
  app.use(passport.session());
  app.use(cookieParser());
  app.use(require('body-parser').urlencoded({ extended: true }));
  app.use(require('express-session')({ secret: 'keyboard cat', resave: true, saveUninitialized: true }));
  
  
  passport.serializeUser(function (user, done) {
      done(null, user);
  });
  
  passport.deserializeUser(function (user, done) {
      done(null, user);
  });
  
  
  
  router.get('/', passport.authenticate('facebook'), function (req, res) {
      console.log(req.isAuthenticated());
      console.log(req.user);
      res.sendFile(path.resolve('./public/adwall.html'));
  });
  
  
  module.exports = router;
  </code></pre>
  
  <p>any help would be appreciated! Thank you!</p>
  
  <p>Edit: Also I added this strategy in my server file:</p>
  
  <p>here is the strategy for the facebook auth that I am using in a different file called server.js:</p>
  
  <pre><code>passport.use(new Strategy({
      clientID: process.env.FACEBOOK_APP_ID,
      clientSecret: process.env.FACEBOOK_SECRET,
      callbackURL: 'http://localhost:8080/facebook/auth/cb'
  },
      function (accessToken, refreshToken, profile, cb) {
          return cb(null, profile);
      }));
  </code></pre>
  
  <p>Here is the link to the github project: 
  <a href="https://github.com/jeremytaylor7/wallaby-ads-project" rel="nofollow noreferrer">https://github.com/jeremytaylor7/wallaby-ads-project</a></p>