<commit_before>var passport = require('passport');
var GoogleStrategy = require('passport-google').Strategy;

passport.use(new GoogleStrategy({
    returnURL: 'http://localhost:3000/console',
    realm: 'http://localhost:3000'
  },
  function(identifier, profile, done) {
    User.findOrCreate({ openId: identifier }, function(err, user) {
      done(err, user);
    });
  }
));

module.exports = passport;<commit_msg>configures passport for oAuth<commit_after>var passport = require('passport');
var GoogleStrategy = require('passport-google').Strategy;
var signIn = require('../routes/userQueries.js').signIn;

passport.use(new GoogleStrategy({
    returnURL: 'http://localhost:3000/console',
    realm: 'http://localhost:3000'
  },
  function(identifier, profile, done) {
    signIn(identifier, profile, done); //repeated arguments for readability
  }
));

passport.serializeUser(function(user, done) {
  done(null, user);
});

passport.deserializeUser(function(user, done) {
  done(null, user);
});

module.exports = passport;
{'fraction_non_alphanumeric': 0.15922330097087378, 'fraction_numerical': 0.015533980582524271, 'mean_word_length': 5.136904761904762, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5776892', 'n_tokens_mistral': 327, 'n_tokens_neox': 312, 'n_words': 61}