<commit_before>'use strict';

const passport = require('passport');
const FacebookStrategy = require('passport-facebook');

module.exports = function (config, userData) {
  const facebookStrategy = new FacebookStrategy({
    clientID: config.facebookAppId,
    clientSecret: config.facebookAppSecret,
    callbackURL: 'http://localhost:3002/account/login/facebook/callback'
  },
    function (accessToken, refreshToken, profile, next) {
      userData.getUserByFacebookId(profile.id)
        .then((user) => {
          if (user) {
            return next(null, user);
          }

          return userData.createUserFromFacebookUser(profile);
        })
        .then((user) => {
          next(null, user);
        })
        .catch((err) => {
          console.log(err);
          next(err, false);
        });
    });

  passport.use(facebookStrategy);
};<commit_msg>fixed callback url<commit_after>'use strict';

const passport = require('passport');
const FacebookStrategy = require('passport-facebook');

module.exports = function (config, userData) {
  const facebookStrategy = new FacebookStrategy({
    clientID: config.facebookAppId,
    clientSecret: config.facebookAppSecret,
    callbackURL: 'https://paycheck-app.herokuapp.com/account/login/facebook/callback'
  },
    function (accessToken, refreshToken, profile, next) {
      userData.getUserByFacebookId(profile.id)
        .then((user) => {
          if (user) {
            return next(null, user);
          }

          return userData.createUserFromFacebookUser(profile);
        })
        .then((user) => {
          next(null, user);
        })
        .catch((err) => {
          console.log(err);
          next(err, false);
        });
    });

  passport.use(facebookStrategy);
};
{'fraction_non_alphanumeric': 0.13507377979568672, 'fraction_numerical': 0.0022701475595913734, 'mean_word_length': 2.6729166666666666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5366253', 'n_tokens_mistral': 505, 'n_tokens_neox': 490, 'n_words': 90}