diff --git a/layouts/domeeniotsing.tpl b/layouts/domeeniotsing.tpl index ec38f7e..44b53a3 100644 --- a/layouts/domeeniotsing.tpl +++ b/layouts/domeeniotsing.tpl @@ -3,19 +3,17 @@
{% include "html-head" %} - + + + {% include "cookie-modal" %} @@ -423,11 +421,10 @@ return !!(regex.exec(domain)); }, - resetCaptcha: function () { - grecaptcha.reset(window.captchaID); - setTimeout(function () { - console.log($("body > div").last().addClass("newChallengeBox")); - }, 1000); + resetCaptcha: function () { + grecaptcha.execute('6LcvvDoeAAAAAJig46j3KoOMcXDaCYAGvIb9f12v', {action: 'check'}).then(function(token) { + window.captchaID = token; + }); }, updateQueryString: function (key, value) { @@ -562,13 +559,14 @@ }, fetchExtraDomainInfo: function () { - var g_recaptcha_response = grecaptcha.getResponse(window.captchaID); + + var g_recaptcha_response = window.captchaID; if (g_recaptcha_response === "") { $('.g-recaptcha').addClass('error'); } else { $('.g-recaptcha').removeClass('error'); this.loadingDomain = true; - this.$http.get(this.WHOIS_HOST + punycode.toASCII(this.domain.name.split(" ")[0]) + '.json?g-recaptcha-response=' + g_recaptcha_response).then(function (response) { + this.$http.get(this.WHOIS_HOST + punycode.toASCII(this.domain.name.split(" ")[0]) + '.json?g-recaptcha-response-data[check]=' + g_recaptcha_response +'&g-recaptcha-response=' + g_recaptcha_response).then(function (response) { var data = response.body; if (data) { this.domain = data;