<commit_before>import express from 'express';
import graphQLHTTP from 'express-graphql';
import {Schema} from './data/schema';
import writeSchema from './data/writeSchema';
import path from 'path';
import fallback from 'express-history-api-fallback';
import bodyParser from 'body-parser';
import session from 'express-session';
import BSD from './bsd';
import MG from './mail';
import demoData from './data/demo.json';
import models from './data/models'
import {fromGlobalId} from 'graphql-relay'
import passport from 'passport';
import LocalStrategy  from 'passport-local'
import SequelizeStoreFactory from 'connect-session-sequelize'

writeSchema();

const SequelizeStore = SequelizeStoreFactory(session.Store)
const Mailgun = new MG(process.env.MAILGUN_KEY, process.env.MAILGUN_DOMAIN);
const BSDClient = new BSD(process.env.BSD_HOST, process.env.BSD_API_ID, process.env.BSD_API_SECRET);
const port = process.env.APP_PORT;
const publicPath = path.resolve(__dirname, '../frontend/public');

passport.use('signup', new LocalStrategy(
  {
    usernameField: 'email',
    passwordField: 'password',
    passReqToCallback: true
  },
  async (req, email, password, done) => {
    let user = await models.User.findOne({
      where: {
        email: email
      }
    });

    if (!user) {
      let newUser = await models.User.create({
        email: email,
        password: password,
      });
      return done(null, newUser);
    }
    else if (!await user.verifyPassword(password)) {
      return done(null, false, { message: 'Incorrect password.' });<commit_msg>Use PORT if available<commit_after>import express from 'express';
import graphQLHTTP from 'express-graphql';
import {Schema} from './data/schema';
import writeSchema from './data/writeSchema';
import path from 'path';
import fallback from 'express-history-api-fallback';
import bodyParser from 'body-parser';
import session from 'express-session';
import BSD from './bsd';
import MG from './mail';
import demoData from './data/demo.json';
import models from './data/models'
import {fromGlobalId} from 'graphql-relay'
import passport from 'passport';
import LocalStrategy  from 'passport-local'
import SequelizeStoreFactory from 'connect-session-sequelize'

writeSchema();

const SequelizeStore = SequelizeStoreFactory(session.Store)
const Mailgun = new MG(process.env.MAILGUN_KEY, process.env.MAILGUN_DOMAIN);
const BSDClient = new BSD(process.env.BSD_HOST, process.env.BSD_API_ID, process.env.BSD_API_SECRET);
const port = process.env.PORT || process.env.APP_PORT;
const publicPath = path.resolve(__dirname, '../frontend/public');

passport.use('signup', new LocalStrategy(
  {
    usernameField: 'email',
    passwordField: 'password',
    passReqToCallback: true
  },
  async (req, email, password, done) => {
    let user = await models.User.findOne({
      where: {
        email: email
      }
    });

    if (!user) {
      let newUser = await models.User.create({
        email: email,
        password: password,
      });
      return done(null, newUser);
    }
    else if (!await user.verifyPassword(password)) {
      return done(null, false, { message: 'Incorrect password.' });
{'fraction_non_alphanumeric': 0.1272957568081064, 'fraction_numerical': 0.0, 'mean_word_length': 4.128246753246753, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7448368', 'n_tokens_mistral': 950, 'n_tokens_neox': 939, 'n_words': 264}