Advanced Node Social Auth II

Tell us what’s happening:
Can’t get Social Auth 2 to pass at all. I’ve got every other challenge in the section to pass, But this one keeps failing on the “GitHub strategy should be set up correctly thus far.” test case. I’ve even tried just flat out copy-pasting the code in the finished example: into my auth.js, but that still doesn’t make it pass. Does anyone know how to get this test case to pass?

Your code so far

/* eslint-disable */

const passport = require("passport");

const LocalStrategy = require("passport-local");

const bcrypt = require("bcrypt");

const ObjectID = require("mongodb").ObjectID;

const GitHubStrategy = require("passport-github").Strategy;

module.exports = function (app, myDataBase) {

  passport.serializeUser((user, done) => {

    done(null, user._id);


  passport.deserializeUser((id, done) => {

    myDataBase.findOne({ _id: new ObjectID(id) }, (err, doc) => {

      if (err) return console.error(err);

      done(null, doc);




    new LocalStrategy(function (username, password, done) {

      myDataBase.findOne({ username: username }, function (err, user) {

        console.log("User " + username + " attempted to log in.");

        if (err) {

          return done(err);


        if (!user) {

          return done(null, false);


        if (!bcrypt.compareSync(password, user.password)) {

          return done(null, false);


        return done(null, user);





    new GitHubStrategy(


        clientID: process.env.GITHUB_CLIENT_ID,

        clientSecret: process.env.GITHUB_CLIENT_SECRET,




      function (accessToken, refreshToken, profile, cb) {


        // Database logic here with callback containing our user object





Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36.

Challenge: Implementation of Social Authentication II

Link to the challenge:

Welcome, Zireael.

Would you mind sharing a link to your project?

Which tests are you failing? What do the app logs/console say? Can you see any errors in the browser console, on the page where you submit the link?