<commit_before>/* global options, d3pie */

var pie = new d3pie('results', { // eslint-disable-line new-cap
	data: {
		content: options
	}
});
<commit_msg>Try to make logout work (not working). Post to /logout should work according to spring security docs.<commit_after>/* global options, d3pie */
var logout = document.getElementById('logout');
console.log(logout);
logout.onclick = (e) => {
	httpPost('/logout')
		.then((response) => {
			console.log(response);
		})		
		.catch((err) => console.log(err));
}

function httpPost(url) {
	return new Promise(
	    function (resolve, reject) {
	        var request = new XMLHttpRequest();
	        request.onreadystatechange = function () {
	            if (this.status === 200) {
	            	resolve(this.response);
				} else {
			        reject(new Error(this.statusText));
			    }
			};
	        request.onerror = function () {
	        	reject(new Error('XMLHttpRequest Error: '+ this.statusText));
	        };
	        request.open('POST', url);
	        request.send();    
	});
}


{'fraction_non_alphanumeric': 0.15206929740134745, 'fraction_numerical': 0.005774783445620789, 'mean_word_length': 2.6491228070175437, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '6693386', 'n_tokens_mistral': 349, 'n_tokens_neox': 313, 'n_words': 74}