<commit_before>const router = require('express').Router();
// Custom Node Helper
const usersData = require('../data/').user;

router.get('/', (req, res) => {
	if (!req.user) {
		return res.redirect('/log_in');
	}
	const userInfo = {
		avatar: req.user.avatar,
		username: req.user.username,
		email: req.user.email,
		gender: (req.user.isMale) ? "Male" : "Female",
	};
	console.log(userInfo);
	return res.render('profile/profile', userInfo);
});

router.get('/edit/', (req, res) => {
    if (!req.user) {
		return res.redirect('/log_in');
	}
    const userInfo = {
		avatar: req.user.avatar,
		username: req.user.username,
		email: req.user.email,
		gender: (req.user.isMale),
        layout: false,
	};
    console.log(userInfo);
    return res.render('profile/editProfile.handlebars', userInfo);
});

router.post('/edit/', (req, res) => {
    if (!req.user) {
		return res.redirect('/log_in');
	}
    usersData.updateUser(req.user._id, req.body).then((newProfile) => {
        newProfile.gender = (newProfile.isMale) ? "Male" : "Female",
        newProfile.layout = false;
        return res.render('profile/profile.handlebars', newProfile);
    }).catch((err) => {
        console.log(err);
        return res.status(500).json({error: err});
    });
});

module.exports = exports = router;<commit_msg>Remove logging because make include base64<commit_after>const router = require('express').Router();
// Custom Node Helper
const usersData = require('../data/').user;

router.get('/', (req, res) => {
	if (!req.user) {
		return res.redirect('/log_in');
	}
	const userInfo = {
		avatar: req.user.avatar,
		username: req.user.username,
		email: req.user.email,
		gender: (req.user.isMale) ? "Male" : "Female",
	};
	return res.render('profile/profile', userInfo);
});

router.get('/edit/', (req, res) => {
    if (!req.user) {
		return res.redirect('/log_in');
	}
    const userInfo = {
		avatar: req.user.avatar,
		username: req.user.username,
		email: req.user.email,
		gender: (req.user.isMale),
        layout: false,
	};
    return res.render('profile/editProfile.handlebars', userInfo);
});

router.post('/edit/', (req, res) => {
    if (!req.user) {
		return res.redirect('/log_in');
	}
    usersData.updateUser(req.user._id, req.body).then((newProfile) => {
        newProfile.gender = (newProfile.isMale) ? "Male" : "Female",
        newProfile.layout = false;
        return res.render('profile/profile.handlebars', newProfile);
    }).catch((err) => {
        console.log(err);
        return res.status(500).json({error: err});
    });
});

module.exports = exports = router;
{'fraction_non_alphanumeric': 0.19489559164733178, 'fraction_numerical': 0.0030935808197989174, 'mean_word_length': 3.392190152801358, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '6110976', 'n_tokens_mistral': 928, 'n_tokens_neox': 881, 'n_words': 164}