<commit_before>var passport = require('passport');

module.exports = function(req, res, next) {
	passport.authenticate('local-signup', function(err, user, info) {
		if (err) return next(err);
		if (!user) return res.json(info);
		req.logIn(user, function(err) {
			if (err) return next(err);
			return res.json({redirect: '/success'});
		});
	}) (req, res, next)<commit_msg>refactored for updated local-signup strategy<commit_after>var passport = require('passport');

module.exports = function(req, res, next) {
	passport.authenticate('local-signup', function(err, user, info) {
		console.log('INFO: ', info)
		if (err) return res.json(err);
		req.logIn(user, function(err) {
			if (err) return res.json({err: err, message: 'error loggin in'});
			return res.json({
				redirect: '/success',
				'message': 'success'
			});
		});
	}) (req, res, next)
{'fraction_non_alphanumeric': 0.1809635722679201, 'fraction_numerical': 0.0, 'mean_word_length': 4.718120805369128, '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': '5134062', 'n_tokens_mistral': 319, 'n_tokens_neox': 289, 'n_words': 71}