<commit_before>

angular.module('gameApp')

        .controller('LoginController', ['$rootScope', '$cookieStore', '$http', function ($rootScope, $cookieStore, $http) {
                this.setUser = function () {
                    var loginName = document.getElementById("login-textbox").value;
                    var joinData = JSON.stringify({Command: "Join", Data: {CurrentPlayer: loginName}});
                    postData(joinData);
                    writeCookie("Username", loginName);
                    console.log("Logged in as: " + loginName);
                    //$cookieStore.put("Username", $rootScope.username);
                };

                this.facebook = function () {
                    var id = makeID();
                    var url = 'OAuthServlet?service=facebook&id=' + id;
                    $http({method: 'POST', url: url, headers: {'Content-Type': 'text/plain'}}).success(
                            function (responseData) {
                                window.open(responseData, "_self");
                            });
                };

                this.google = function () {
                    var id = makeID();
                    var url = 'OAuthServlet?service=google&id=' + id;
                    $http({method: 'POST', url: url, headers: {'Content-Type': 'text/plain'}}).success(
                            function (responseData) {
                                window.open(responseData, "_self");
                            });
                };

                this.loginVis = function () {
                    return(document.cookie.indexOf("Username") >= 0);
                };

                this.delCookie = function () {
                    var cookie = readCookie();
                    console.log("deleting cookie: " + cookie);
                    for (var index in cookie) {
                        var name = cookie[index];
                    }
                    name = name.replace('Username=', '');
                    var quitData = JSON.stringify({Command: "Quit", Data: {CurrentPlayer: $rootScope.thisPlayer}});
                    document.cookie = "Username=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
                    postData(quitData);
                    $rootScope.$apply();
                };

                function readCookie() {
                    var x = document.cookie;
                    return x.split("; ");
                }

                function postData(data) {
                    $http({
                        method: 'POST',<commit_msg>Stopped oauth breaking everything<commit_after>

angular.module('gameApp')

        .controller('LoginController', ['$rootScope', '$cookieStore', '$http', function ($rootScope, $cookieStore, $http) {
                this.setUser = function () {
                    var loginName = document.getElementById("login-textbox").value;
                    var joinData = JSON.stringify({Command: "Login", Data: {Username: loginName}});
                    postData(joinData);
//                    writeCookie("Username", loginName);
                    console.log("Logged in as: " + loginName);
                    //$cookieStore.put("Username", $rootScope.username);
                };

                this.facebook = function () {
                    var id = makeID();
                    var url = 'OAuthServlet?service=facebook&id=' + id;
                    console.log(url);
                    $http({method: 'POST', url: url, headers: {'Content-Type': 'text/plain'}}).success(
                            function (responseData) {
                                window.open(responseData, "_self");
                            });
                };

                this.google = function () {
                    var id = makeID();
                    var url = 'OAuthServlet?service=google&id=' + id;
                    console.log(url);
                    $http({method: 'POST', url: url, headers: {'Content-Type': 'text/plain'}}).success(
                            function (responseData) {
                                window.open(responseData, "_self");
                            });
                };

                this.loginVis = function () {
//                    return(document.cookie.indexOf("Username") >= 0);
                    if (typeof $rootScope.userName === "undefined") {
                        return true;
                    } else {
                        return false;
                    }
                };

                this.delCookie = function () {
                    var cookie = readCookie();
                    console.log("deleting cookie: " + cookie);
                    for (var index in cookie) {
                        var name = cookie[index];
                    }
                    name = name.replace('Username=', '');
                    var quitData = JSON.stringify({Command: "Quit", Data: {CurrentPlayer: $rootScope.thisPlayer}});
                    document.cookie = "Username=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
                    postData(quitData);
                    $rootScope.$apply();
                };

                function readCookie() {
                    var x = document.cookie;
                    return x.split("; ");
                }

                function postData(data) {
                    $http({
                        method: 'POST',
{'fraction_non_alphanumeric': 0.12416974169741697, 'fraction_numerical': 0.004797047970479705, 'mean_word_length': 1.1832460732984293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7297514', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1184, 'n_words': 257}