<commit_before>app.controller("VerifyController", [
    "$scope",
    "$location",
    "$log",
    "$localStorage",
    "Request",
    "domainBase",
    "whoisUrl",
    "verifyUrl",
    function ($scope, $location, $log, $localStorage, Request, domainBase, whoisUrl, verifyUrl) {
        'use strict';
        if (!!!$localStorage.domain) {
            $location.path('/');
        }

        var expression = /[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi;
        var regex = new RegExp(expression);

        function init() {
            // body...
            $scope.domainData = $localStorage.domain;
            console.log($scope.domainData);
        }


        $scope.whois = function (forced) {
            forced = !!forced;

            $scope.error = null;
            $scope.warn = null;
            $scope.status = null;
            $scope.disableBtn = true;
            if (!!!$scope.domain.match(regex)) {
                $scope.error = "Your input is not a valid domain name.";
                $scope.status = 400;
            } else {
                var data = ($.url($scope.domain)).attr();
                var requestUrl = domainBase + whoisUrl;
                data.base = data.protocol ? data.base : 'http://' + data.base;
                data.forced = forced;

                Request.fetch(requestUrl, data)
                    .then(function (response) {
                        // body...
                        if (!response.success) {
                            $scope.warn = response.message;
                            $scope.status = response.status + ' -';
                        }
                        $localStorage.domain = response.data;

                        $location.path('/verify');

                    }, function (error) {
                        // body...
                        console.log(error);
                        $scope.error = "We cannot verify your domain at this time.";
                        // $scope.status = error.status + ' -';
                    });
            }

            $scope.disableBtn = false;

        };

        init();

        $scope.verify = function (type) {

            $scope.disableBtn = true;
            var requestUrl = domainBase + verifyUrl;
            var data = $scope.domainData;
            data.verification_type = type;
            console.log(data);
            Request.fetch(requestUrl, data)
                .then(function (response) {
                    // body...
                    if (!response.success) {
                        $scope.warn = response.message;
                        $scope.status = response.status + ' -';
                    }
                    $localStorage.domain = response.data;
                    $scope.domainData = $localStorage.domain;

                    $location.path('/verify');

                }, function (error) {
                    // body...
                    $scope.error = error.statusText + ". We've notified the developers.";
                    $scope.status = error.status + ' -';
                });
            $scope.disableBtn = false;

        }

        $log.debug("Verify Controller Initialized");
    }]);<commit_msg>update verify controller<commit_after>app.controller("VerifyController", [
    "$scope",
    "$location",
    "$log",
    "$localStorage",
    "Request",
    "domainBase",
    "whoisUrl",
    "verifyUrl",
    function ($scope, $location, $log, $localStorage, Request, domainBase, whoisUrl, verifyUrl) {
        'use strict';
        if (!!!$localStorage.domain) {
            $location.path('/');
        }

        var expression = /[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi;
        var regex = new RegExp(expression);

        function init() {
            // body...
            $scope.domainData = $localStorage.domain;
            console.log($scope.domainData);
        }


        $scope.whois = function (forced) {
            forced = !!forced;

            $scope.error = null;
            $scope.warn = null;
            $scope.status = null;
            $scope.disableBtn = true;
            if (!!!$scope.domain.match(regex)) {
                $scope.error = "Your input is not a valid domain name.";
                $scope.status = 400;
            } else {
                var data = ($.url($scope.domain)).attr();
                var requestUrl = domainBase + whoisUrl;
                data.base = data.protocol ? data.base : 'http://' + data.base;
                data.forced = forced;

                Request.fetch(requestUrl, data)
                    .then(function (response) {
                        // body...
                        if (!response.success) {
                            $scope.warn = response.message;
                            $scope.status = response.status + ' -';
                        }
                        $localStorage.domain = response.data;


                        $location.path('/verify');

                    }, function (error) {
                        // body...
                        console.log(error);
                        $scope.error = "We cannot verify your domain at this time.";
                        // $scope.status = error.status + ' -';
                    });
            }

            $scope.disableBtn = false;

        };
        $scope.verify = function (type) {

            $scope.disableBtn = true;
            var requestUrl = domainBase + verifyUrl;
            var data = $scope.domainData;
            data.verification_type = type;

            Request.fetch(requestUrl, data)
                .then(function (response) {
                    // body...
                    if (!response.data.success) {
                        $scope.warn = response.message;
                        $scope.status = response.status + ' -';
                    } else {
                        console.log(response);
                        $localStorage.verified = response.data.success;
                        console.log(response);
                        $location.path('/signup');
                    }

                }, function (error) {
                    // body...
                    console.log(error);
                    alert('Cannot verify your domain name. Please try again');
                    $scope.error = "We've notified the developers.";
                    $scope.status = error.status + ' -';
                });
            $scope.disableBtn = false;

        }

        init();

        $log.debug("Verify Controller Initialized");
    }]);
{'fraction_non_alphanumeric': 0.13917370325693607, 'fraction_numerical': 0.0039203860072376355, 'mean_word_length': 1.1612903225806452, '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': '3858802', 'n_tokens_mistral': 1745, 'n_tokens_neox': 1636, 'n_words': 324}