<commit_before>'use strict';

/* Services */

envyLeagueApp.factory('Register', function ($resource) {
        return $resource('rest/user/register', {}, {
        });
    });

envyLeagueApp.factory('Activate', function ($resource) {
        return $resource('rest/user/activate', {}, {
            'get': { method: 'GET', params: {}, isArray: false}
        });
    });

envyLeagueApp.factory('Session', function () {
        this.create = function (login, firstName, lastName, email, facebookUserId, userRoles) {
            this.login = login;
            this.firstName = firstName;
            this.lastName = lastName;
            this.email = email;
            this.facebookUserId = facebookUserId;
            this.userRoles = userRoles;
        };
        this.invalidate = function () {
            this.login = null;
            this.firstName = null;
            this.lastName = null;
            this.email = null;
            this.facebookUserId = null;
            this.userRoles = null;
        };
        return this;
    });
envyLeagueApp.factory('UserService', function ($resource) {
        return $resource('rest/user', {}, {
        });
    });
envyLeagueApp.factory('SocialService', function ($resource, $http) {
        this.validate: function(data) {
            $http.get('rest/social/facebook/validate')
                .success(function (data, status, headers, config) {
                    //TODO
                }.error(function (data, status, headers, config) {

                }
        }
        return this;
    });

envyLeagueApp.factory('AuthenticationSharedService', function ($rootScope, $http, authService, Session, UserService) {
        return {
            login: function (param) {
                var data ="j_username=" + encodeURIComponent(param.username) +"&j_password=" + encodeURIComponent(param.password) +"&_spring_security_remember_me=" + param.rememberMe +"&submit=Login";
                $http.post('user/authentication', data, {
                    headers: {
                        "Content-Type": "application/x-www-form-urlencoded"
                    },
                    ignoreAuthModule: 'ignoreAuthModule'
                }).success(function (data, status, headers, config) {
                    UserService.get(function(data) {
                        Session.create(data.login, data.firstName, data.lastName, data.email, data.facebookUserId, data.roles);
                        $rootScope.account = Session;
                        authService.loginConfirmed(data);
                    });
                }).error(function (data, status, headers, config) {
                    $rootScope.authenticationError = true;
                    Session.invalidate();
                });
            },
            valid: function (authorizedRoles) {

                $http.get('protected/authentication_check.gif', {
                    ignoreAuthModule: 'ignoreAuthModule'<commit_msg>Corrected unused js code<commit_after>'use strict';

/* Services */

envyLeagueApp.factory('Register', function ($resource) {
        return $resource('rest/user/register', {}, {
        });
    });

envyLeagueApp.factory('Activate', function ($resource) {
        return $resource('rest/user/activate', {}, {
            'get': { method: 'GET', params: {}, isArray: false}
        });
    });

envyLeagueApp.factory('Session', function () {
        this.create = function (login, firstName, lastName, email, facebookUserId, userRoles) {
            this.login = login;
            this.firstName = firstName;
            this.lastName = lastName;
            this.email = email;
            this.facebookUserId = facebookUserId;
            this.userRoles = userRoles;
        };
        this.invalidate = function () {
            this.login = null;
            this.firstName = null;
            this.lastName = null;
            this.email = null;
            this.facebookUserId = null;
            this.userRoles = null;
        };
        return this;
    });
envyLeagueApp.factory('UserService', function ($resource) {
        return $resource('rest/user', {}, {
        });
    });
envyLeagueApp.factory('SocialService', function ($resource, $http) {
        this.validate = function(data) {
        };
        return this;
    });

envyLeagueApp.factory('AuthenticationSharedService', function ($rootScope, $http, authService, Session, UserService) {
        return {
            login: function (param) {
                var data ="j_username=" + encodeURIComponent(param.username) +"&j_password=" + encodeURIComponent(param.password) +"&_spring_security_remember_me=" + param.rememberMe +"&submit=Login";
                $http.post('user/authentication', data, {
                    headers: {
                        "Content-Type": "application/x-www-form-urlencoded"
                    },
                    ignoreAuthModule: 'ignoreAuthModule'
                }).success(function (data, status, headers, config) {
                    UserService.get(function(data) {
                        Session.create(data.login, data.firstName, data.lastName, data.email, data.facebookUserId, data.roles);
                        $rootScope.account = Session;
                        authService.loginConfirmed(data);
                    });
                }).error(function (data, status, headers, config) {
                    $rootScope.authenticationError = true;
                    Session.invalidate();
                });
            },
            valid: function (authorizedRoles) {

                $http.get('protected/authentication_check.gif', {
                    ignoreAuthModule: 'ignoreAuthModule'
{'fraction_non_alphanumeric': 0.1266090636572033, 'fraction_numerical': 0.0, 'mean_word_length': 1.8689934243803743, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1211978', 'n_tokens_mistral': 1485, 'n_tokens_neox': 1435, 'n_words': 266}