<commit_before>(function () {
    "use strict";

    angular.module("mfl.auth.controllers", [
        "mfl.auth.services",
        "ui.router"
    ])

    .controller("mfl.auth.controllers.login",
        ["$scope", "$sce", "$state", "mfl.auth.services.login",
        function ($scope, $sce, $state, loginService) {
            $scope.test = "Login";
            $scope.login_err = "";
            $scope.login_err_html = "";

            $scope.submitUser = function(obj) {
                var error_fxn = function (data) {
                    $scope.login_err = data.data.error_description || data.data.detail;
                    $scope.login_err_html =  $sce.trustAsHtml($scope.login_err);
                };
                var success_fxn = function () {
                    $state.go("home");
                };
                loginService.login(obj)
                    .then(
                        function () {
                            loginService.currentUser().then(success_fxn, error_fxn);
                        },
                        error_fxn
                    );
            };
        }
    ]);

})(angular);<commit_msg>Set dashboard as next state after logging in<commit_after>(function () {
    "use strict";

    angular.module("mfl.auth.controllers", [
        "mfl.auth.services",
        "ui.router"
    ])

    .controller("mfl.auth.controllers.login",
        ["$scope", "$sce", "$state", "mfl.auth.services.login",
        function ($scope, $sce, $state, loginService) {
            $scope.test = "Login";
            $scope.login_err = "";
            $scope.login_err_html = "";

            $scope.submitUser = function(obj) {
                var error_fxn = function (data) {
                    $scope.login_err = data.data.error_description || data.data.detail;
                    $scope.login_err_html =  $sce.trustAsHtml($scope.login_err);
                };
                var success_fxn = function () {
                    $state.go("dashboard");
                };
                loginService.login(obj)
                    .then(
                        function () {
                            loginService.currentUser().then(success_fxn, error_fxn);
                        },
                        error_fxn
                    );
            };
        }
    ]);

})(angular);
{'fraction_non_alphanumeric': 0.13504273504273503, 'fraction_numerical': 0.0, 'mean_word_length': 1.299607072691552, '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': '1434377', 'n_tokens_mistral': 657, 'n_tokens_neox': 620, 'n_words': 90}