<commit_before>'use strict';

var database = require('./database');

module.exports = function (app) {
    return {
        onconfig: function (config, next) {
            /*
             * Add any additional config setup or overrides here. `config` is an initialized
             * `confit` (https://github.com/krakenjs/confit/) configuration object.
             */

            var dbConfig = config.get('databaseConfig');
            var db = database(dbConfig);

            app.set('db', db);

            var passport = require('passport');
            var auth = require('./auth');
            var flash = require('connect-flash');
            var session = require('express-session');
            var Users = require('../models/users');


            passport.use(new auth.localStrategy());
            passport.serializeUser(function (user, done) {
                done(null, user.id);
            });

            passport.deserializeUser(function (id, done) {
                if (id === "test") {

                    var user = {
                        id: 'test',
                        username: 'bob',
                        password: '<PASSWORD>',
                        role: 'admin'
                    };
                    done(null, user);
                }
                else {

                    Users.get(id, function (err, user) {
                        done(null, user);
                    })
                }

            });

            app.use(session({secret: 'keyboard cat'}))
                .use(passport.initialize())
                .use(passport.session())
                .use(flash())
                .use(auth.injectUser);
            next(null, config);
        }
    };
};<commit_msg>feat(conf.js): fix bob's ids<commit_after>'use strict';

var database = require('./database');

module.exports = function (app) {
    return {
        onconfig: function (config, next) {
            /*
             * Add any additional config setup or overrides here. `config` is an initialized
             * `confit` (https://github.com/krakenjs/confit/) configuration object.
             */

            var dbConfig = config.get('databaseConfig');
            var db = database(dbConfig);

            app.set('db', db);

            var passport = require('passport');
            var auth = require('./auth');
            var flash = require('connect-flash');
            var session = require('express-session');
            var Users = require('../models/users');


            passport.use(new auth.localStrategy());
            passport.serializeUser(function (user, done) {
                done(null, user.id);
            });

            passport.deserializeUser(function (id, done) {
                if (id === "00") {

                    var user = {
                        id: '00',
                        username: 'bob',
                        password: '<PASSWORD>',
                        role: 'admin'
                    };
                    done(null, user);
                }
                else {

                    Users.get(id, function (err, user) {
                        done(null, user);
                    })
                }

            });
            //require('./dust-helper');
            app.use(session({secret: 'keyboard cat'}))
                .use(passport.initialize())
                .use(passport.session())
                .use(flash())
                .use(auth.injectUser);
            next(null, config);
        }
    };
};
{'fraction_non_alphanumeric': 0.13010204081632654, 'fraction_numerical': 0.0011337868480725624, 'mean_word_length': 1.1946517412935322, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '5340710', 'n_tokens_mistral': 888, 'n_tokens_neox': 828, 'n_words': 190}