<commit_before>import Vue from 'vue';

const HOST = getCurrentHost() + ':8080';
const DO_NOT_INTERCEPT = { 'DO_NOT_INTERCEPT': 'enabled' };

const Http = {

	getUser: function (doNotIntercept) {
		return Vue.http.get(HOST + '/auth/common/user-account',
			doNotIntercept ? { headers: DO_NOT_INTERCEPT } : undefined);
	},

	login: function (credentials, doNotIntercept) {
		return Vue.http.post(HOST + '/user-account/login', credentials,
			doNotIntercept ? { headers: DO_NOT_INTERCEPT } : undefined);
	},

	adminGetAccounts: function () {
		return Vue.http.get(HOST + '/auth/admin/accounts');
	}

};

export default Http;

function getCurrentHost () {
	let protocol = window.location.protocol;
	if (/[^:]$/.test(protocol)) {
		protocol += ':';
	}
	let hostname = window.location.hostname;

	return protocol + '//' + hostname;
}<commit_msg>adapt front-end to back-end changes (request methods)<commit_after>import Vue from 'vue';

const HOST = getCurrentHost() + ':8080';
const DO_NOT_INTERCEPT = { 'DO_NOT_INTERCEPT': 'enabled' };

const Http = {

	getUser: function (doNotIntercept) {
		return Vue.http.get(HOST + '/auth/common/user-account',
			doNotIntercept ? { headers: DO_NOT_INTERCEPT } : undefined);
	},

	login: function (credentials, doNotIntercept) {
		return Vue.http.put(HOST + '/user-account/login', credentials,
			doNotIntercept ? { headers: DO_NOT_INTERCEPT } : undefined);
	},

	adminGetAccounts: function () {
		return Vue.http.get(HOST + '/auth/admin/accounts');
	}

};

export default Http;

function getCurrentHost () {
	let protocol = window.location.protocol;
	if (/[^:]$/.test(protocol)) {
		protocol += ':';
	}
	let hostname = window.location.hostname;

	return protocol + '//' + hostname;
}
{'fraction_non_alphanumeric': 0.15608619685497963, 'fraction_numerical': 0.004659289458357601, 'mean_word_length': 4.419558359621451, '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': '4292785', 'n_tokens_mistral': 616, 'n_tokens_neox': 576, 'n_words': 122}