<commit_before>const express = require("express");
const app = express();
const OAuth2 = require("oauth").OAuth2;

const clientID = "aqh3wb4avo6r5ig0dvfl1n3c0vvi7r";
const clientSecret = "<KEY>";
const safe = require("safe");
const PORT = 80;
const DOMAIN = "172.16.17.32";
const oauth2 = new OAuth2(
	clientID,
	clientSecret,
	'https://api.twitch.tv/',
	'kraken/oauth2/authorize',
	'kraken/oauth2/token',
	null
);

const authURL = oauth2.getAuthorizeUrl({
	redirect_uri: `http://localhost:${PORT}/code`,
	scope: ['chat_login']
});

let token = false;

module.exports = function(cb) {
	app.get("/code", function(req, res, next) {
		oauth2.getOAuthAccessToken(
			req.query.code,
			{'redirect_uri': `http://${DOMAIN}/code/`},
			safe.sure(cb, (access_token, refresh_token, results) => {
				if (results.error)
					return cb(results.error);

				cb(null, access_token);
			})
		);
	});

	app.get("/", function(req, res, next) {
		res.send(`
			<html>
				<body>
					<a href="${authURL}">Click Here</a>
				</body>
			</html>
		`)
	});

	app.listen(PORT);
	console.log("server for auth runned!");
	oauth2.get(authURL, null, function(err, html){
		if (/redirected/.test(html))
			console.log("redirected success!");
	});
};
<commit_msg>small fix<commit_after>const express = require("express");
const app = express();
const OAuth2 = require("oauth").OAuth2;

const clientID = "aqh3wb4avo6r5ig0dvfl1n3c0vvi7r";
const clientSecret = "<KEY>";
const safe = require("safe");
const PORT = 80;
const DOMAIN = "172.16.17.32";
const oauth2 = new OAuth2(
	clientID,
	clientSecret,
	'https://api.twitch.tv/',
	'kraken/oauth2/authorize',
	'kraken/oauth2/token',
	null
);

const authURL = oauth2.getAuthorizeUrl({
	redirect_uri: `http://localhost:${PORT}/code`,
	scope: ['chat_login']
});

let token = false;

module.exports = function(cb) {
	app.get("/code", function(req, res, next) {
		console.log(req.query);
		console.log(req.body);

		oauth2.getOAuthAccessToken(
			req.query.code,
			{'redirect_uri': `http://${DOMAIN}:${PORT}/code/`},
			safe.sure(cb, (access_token, refresh_token, results) => {
				if (results.error)
					return cb(results.error);

				cb(null, access_token);
			})
		);
	});

	app.listen(PORT);
	console.log("server for auth runned!");
	oauth2.get(authURL, null, function(err, html){
		if (/redirected/.test(html))
			console.log("redirected success!");
	});
};

{'fraction_non_alphanumeric': 0.19023569023569023, 'fraction_numerical': 0.02441077441077441, 'mean_word_length': 4.377828054298643, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4051614', 'n_tokens_mistral': 984, 'n_tokens_neox': 899, 'n_words': 169}