<commit_before>User = {
	url: URLS.user,
	getToken: function() {
		return localStorage.token;
	},
	logged: function() {
		if (localStorage.token) return true;
		else return false;
	},
	setToken: function(token) {
		localStorage.token = token;
	},
	login: function(data, done) {
		var setToken = this.setToken;
		$.ajax({
			url: this.url + "/login",
			type: "POST",
			data: data,
			dataType: 'json',
			success: function(data, textStatus, jqXHR) {
				setToken(data.token);
				Nav.setUserButtons();
				Nav.setTabs();

				//TODO: check world login
				done();
			},
			error: function(res) {
				done(res.responseJSON.error);
			}
		});
	},
	signup: function(data, done) {
		var setToken = this.setToken;
		var wsign = this.worldSignup;
		$.ajax({
			url: this.url + "/signup",
			type: "POST",
			data: data,
			dataType: 'json',
			success: function(data, textStatus, jqXHR) {
				setToken(data.token);
				wsign();
				Nav.setUserButtons();
				Nav.setTabs();
				ShipList.loadShips();
				done();
			},
			error: function(res) {
				done(res.responseJSON.error);
			}
		});
	},
	worldSignup: function() {
		var token = localStorage.token; //this.getToken wont work idk why
		$.ajax({
			url: URLS.world + "/user/signup",
			type: "POST",
			data: token,
			headers: {
				'Authorization': 'Bearer ' + token
			},
			dataType: 'json',
			success: function(data, textStatus, jqXHR) {
				console.log("User Logged on World Server");
			},
			error: function(res) {
				console.log(res.responseJSON.error);
			}
		});
	},
	logout: function() {<commit_msg>signup realod<commit_after>User = {
	url: URLS.user,
	getToken: function() {
		return localStorage.token;
	},
	logged: function() {
		if (localStorage.token) return true;
		else return false;
	},
	setToken: function(token) {
		localStorage.token = token;
	},
	login: function(data, done) {
		var setToken = this.setToken;
		$.ajax({
			url: this.url + "/login",
			type: "POST",
			data: data,
			dataType: 'json',
			success: function(data, textStatus, jqXHR) {
				setToken(data.token);
				Nav.setUserButtons();
				Nav.setTabs();

				//TODO: check world login
				done();
			},
			error: function(res) {
				done(res.responseJSON.error);
			}
		});
	},
	signup: function(data, done) {
		var setToken = this.setToken;
		var wsign = this.worldSignup;
		$.ajax({
			url: this.url + "/signup",
			type: "POST",
			data: data,
			dataType: 'json',
			success: function(data, textStatus, jqXHR) {
				setToken(data.token);
				wsign();
				Nav.setUserButtons();
				Nav.setTabs();
				//ShipList.loadShips();
				done();
			},
			error: function(res) {
				done(res.responseJSON.error);
			}
		});
	},
	worldSignup: function() {
		var token = localStorage.token; //this.getToken wont work idk why
		$.ajax({
			url: URLS.world + "/user/signup",
			type: "POST",
			data: token,
			headers: {
				'Authorization': 'Bearer ' + token
			},
			dataType: 'json',
			success: function(data, textStatus, jqXHR) {
				console.log("User Logged on World Server");
			},
			error: function(res) {
				console.log(res.responseJSON.error);
			}
		});
	},
	logout: function() {
{'fraction_non_alphanumeric': 0.16655989750160155, 'fraction_numerical': 0.0, 'mean_word_length': 3.0348837209302326, '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': '4001046', 'n_tokens_mistral': 1363, 'n_tokens_neox': 1136, 'n_words': 243}