<commit_before>const JwtStrategy = require('passport-jwt').Strategy;
const ExtractJwt = require('passport-jwt').ExtractJwt;

const User = require('../models/user.model');
const { tokenSecret } = require('./main.config');

// Setup work and export for the JWT passport strategy

function initPassport(passport) {
  const opts = {
    jwtFromRequest: ExtractJwt.fromAuthHeader(),
    secretOrKey: tokenSecret,
  };

  passport.use(new JwtStrategy(opts, (jwtPayload, done) => {
    console.log(`---`);
    console.log(jwtPayload);
    console.log(`---`);
    User.findOne({ id: jwtPayload.id })
      .then((user) => {
        return user
          ? done(null, user)
          : done(null, false);
      })
      .catch(error => done(error, false));
  }));
}
<commit_msg>Removed unecessary comments<commit_after>const JwtStrategy = require('passport-jwt').Strategy;
const ExtractJwt = require('passport-jwt').ExtractJwt;

const User = require('../models/user.model');
const { tokenSecret } = require('./main.config');

// Setup work and export for the JWT passport strategy

function initPassport(passport) {
  const opts = {
    jwtFromRequest: ExtractJwt.fromAuthHeader(),
    secretOrKey: tokenSecret,
  };

  passport.use(new JwtStrategy(opts, (jwtPayload, done) => {
    User.findOne({ id: jwtPayload.id })
      .then((user) => {
        return user
          ? done(null, user)
          : done(null, false);
      })
      .catch(error => done(error, false));
  }));
}

{'fraction_non_alphanumeric': 0.15864406779661017, 'fraction_numerical': 0.0, 'mean_word_length': 3.303206997084548, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1173515', 'n_tokens_mistral': 472, 'n_tokens_neox': 469, 'n_words': 97}