<commit_before>const router = require('express').Router();
const bodyParser = require('body-parser').json();
const token = require('../auth/token');
const userModel = require('../models/user');
const portfolioModel = require('../models/portfolio');
const ensureAuth = require('../auth/ensure-auth')();
const ensureRole = require('../auth/ensure-role');

router
    .post('/validate', ensureAuth, bodyParser, (req, res, next) => {
<<<<<<< HEAD
        res.send({valid:true, username: req.user.username});
=======
        console.log(res.body);
        res.send({valid:true});
>>>>>>> b1f028e047aecdb1e623dab111fd3e2c52aa1960
    })

    .post('/signup', bodyParser, (req, res, next) => {
        const {username, password} = req.body;
        delete req.body.password;

        if (!username || !password) {
            return next({
                code: 400,
                error: 'Valid username and password required'
            });
        };

        userModel
            .find({username})<commit_msg>hotfix to merge conflict<commit_after>const router = require('express').Router();
const bodyParser = require('body-parser').json();
const token = require('../auth/token');
const userModel = require('../models/user');
const portfolioModel = require('../models/portfolio');
const ensureAuth = require('../auth/ensure-auth')();
const ensureRole = require('../auth/ensure-role');

router
    .post('/validate', ensureAuth, bodyParser, (req, res, next) => {
        res.send({valid:true, username: req.user.username});
    })

    .post('/signup', bodyParser, (req, res, next) => {
        const {username, password} = req.body;
        delete req.body.password;

        if (!username || !password) {
            return next({
                code: 400,
                error: 'Valid username and password required'
            });
        };

        userModel
            .find({username})
{'fraction_non_alphanumeric': 0.17668776371308018, 'fraction_numerical': 0.014767932489451477, 'mean_word_length': 2.705078125, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 14, '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': '2442191', 'n_tokens_mistral': 553, 'n_tokens_neox': 523, 'n_words': 120}