<commit_before>var express = require('express'),
	moment = require('moment'),
	passport = require('passport'),
	router = express.Router();

router.param('email', function(req, res, next, id) {
	var models = req.app.get('models');

	models.User.find({
		where: { email: email }
	}).then(function(user) {
		if (!user)
			return next(new Error("No such user"));

		req.user = user;
	}).then(next, function (err) {
		next(err);
	});
})

router.get('/login', function(req, res) {
	res.render('login', {next: req.query.next});
});

router.post('/login', function(req, res, next) {
  passport.authenticate('local', function(err, user, info) {
		if (err) { return next(err); }
    if (!user) { return res.redirect('/login'); }
    req.logIn(user, function(err) {
      if (err) { return next(err); }
			console.log(req.body.next);
			if (req.body.next) {
				return res.redirect(req.body.next);
			}
      return res.redirect('/');
    });
	})(req, res, next);
});

router.get('/logout', function(req, res){
	req.logout();
	res.redirect('/');
});

module.exports = router;<commit_msg>Fix indentation<commit_after>var express = require('express'),
	moment = require('moment'),
	passport = require('passport'),
	router = express.Router();

router.param('email', function(req, res, next, id) {
	var models = req.app.get('models');

	models.User.find({
		where: { email: email }
	}).then(function(user) {
		if (!user)
			return next(new Error("No such user"));

		req.user = user;
	}).then(next, function (err) {
		next(err);
	});
})

router.get('/login', function(req, res) {
	res.render('login', {next: req.query.next});
});

router.post('/login', function(req, res, next) {
	passport.authenticate('local', function(err, user, info) {
		if (err) { return next(err); }
		if (!user) { return res.redirect('/user/login'); }
		req.logIn(user, function(err) {
			if (err) { return next(err); }
			console.log(req.body.next);
			if (req.body.next) {
				return res.redirect(req.body.next);
			}
			return res.redirect('/');
		});
	})(req, res, next);
});

router.get('/logout', function(req, res){
	req.logout();
	res.redirect('/');
});

module.exports = router;
{'fraction_non_alphanumeric': 0.21668219944082012, 'fraction_numerical': 0.0, 'mean_word_length': 4.087677725118484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5725149', 'n_tokens_mistral': 800, 'n_tokens_neox': 751, 'n_words': 160}