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

    function LoginController($scope, $location, $window, $timeout, notifier, identity, authService, authConstants) {
        $scope.identity = identity;

        $scope.authExternalProvider = function (provider) {
            authService.authorize()
                .then(function () {
                    var twitterData = identity.getAuthorizationData();
                    if (twitterData) {
                        window.$windowScope = $scope;

                        var authorizationUrl = twitterData.AuthorizationURL;
                        window.open(authorizationUrl, "Authenticate Account", "location=0,status=0,width=800,height=900");
                    }
            });
        };

        $scope.authCompletedCB = function (queryParams) {
            var authorizationData = identity.getAuthorizationData();
            authorizationData.VerifierCode = /oauth_verifier=(\w+)/.exec(queryParams)[1];
            identity.setAuthorizationData(authorizationData);

            authService.authenticate().then(function () {
                $timeout(function () {
                    $location.path('/');
                    notifier.success('Successful login!');
                });
            });
        }
    }

    angular.module('myApp.controllers')
        .controller('LoginController', ['$scope', '$location', '$window', '$timeout', 'notifier', 'identity', 'authService', 'authConstants', LoginController]);
}());<commit_msg>Bug fix when denied login from popup<commit_after>(function () {
    'use strict';

    function LoginController($scope, $location, $window, $timeout, notifier, identity, authService, authConstants) {
        $scope.identity = identity;

        $scope.authExternalProvider = function (provider) {
            authService.authorize()
                .then(function () {
                    var twitterData = identity.getAuthorizationData();
                    if (twitterData) {
                        window.$windowScope = $scope;

                        var authorizationUrl = twitterData.AuthorizationURL;
                        window.open(authorizationUrl, "Authenticate Account", "location=0,status=0,width=800,height=900");
                    }
            });
        };

        $scope.authCompletedCB = function (queryParams) {
            if (queryParams.indexOf('denied') !== -1) {
                notifier.error('Login is denied!');

                return;
            }

            var authorizationData = identity.getAuthorizationData();
            authorizationData.VerifierCode = /oauth_verifier=(\w+)/.exec(queryParams)[1];
            identity.setAuthorizationData(authorizationData);

            authService.authenticate().then(function () {
                $timeout(function () {
                    $location.path('/');
                    notifier.success('Successful login!');
                });
            });
        }
    }

    angular.module('myApp.controllers')
        .controller('LoginController', ['$scope', '$location', '$window', '$timeout', 'notifier', 'identity', 'authService', 'authConstants', LoginController]);
}());
{'fraction_non_alphanumeric': 0.12977581307230818, 'fraction_numerical': 0.005999368487527629, 'mean_word_length': 2.0344827586206895, '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': '1693862', 'n_tokens_mistral': 789, 'n_tokens_neox': 736, 'n_words': 129}