<commit_before>

const LocalStrategy = require('passport-local').Strategy;
const User = require('../models/User');

module.exports = function (passport) {
  passport.use('local-signup', new LocalStrategy({
    usernameField: 'username',
    passwordField: 'password',
    passReqToCallback: true,
  },
        (req, username, password, done) => {
          User.findOne({ 'local.username': username }, (err, user) => {
            if (err) {
              return done(err);
            }
            if (user) {
              return done(null, false);
            }
            const newUser = new User();

            newUser.local.username = username;
            newUser.local.password = <PASSWORD>);
            newUser.save((err, user) => {<commit_msg>join default channel on sign up<commit_after>

const LocalStrategy = require('passport-local').Strategy;
const User = require('../models/User');

module.exports = function (config, passport) {
  passport.use('local-signup', new LocalStrategy({
    usernameField: 'username',
    passwordField: 'password',
    passReqToCallback: true,
  },
        (req, username, password, done) => {
          User.findOne({ 'local.username': username }, (err, user) => {
            if (err) {
              return done(err);
            }
            if (user) {
              return done(null, false);
            }
            const newUser = new User();

            newUser.local.username = username;
            newUser.local.password = <PASSWORD>);
            newUser.local.channels = [config.defaultChannel];
            newUser.save((err, user) => {
{'fraction_non_alphanumeric': 0.13857677902621723, 'fraction_numerical': 0.0, 'mean_word_length': 2.149312377210216, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1829624', 'n_tokens_mistral': 439, 'n_tokens_neox': 435, 'n_words': 102}