reCaptcha not working with latest Chromium 122 release

228 Views Asked by At

since Chrome and Edge got updated last week to version 122 reCaptcha stopped working on my website. What seems to be happening is that the callback doesn't get called. Once user clicks on the checkbox it just gets stuck loading with spinner turning. It was working for years until now with this implementation. The application is impelmented using Java Ice Faces here is a snippet of implementation. Callback never gets called.

<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&amp;render=explicit"
            async="true"
            defer="true">
</script>

<script type="text/javascript">
        var captchaKey = "<the-key>";

        //<![CDATA[

        function onloadCallback(){
            var reCaptchaEl= document.getElementById('re-captcha-main');
            grecaptcha.render('reCaptchaEl', {
                'sitekey' : captchaKey,
                'callback': function () {
                    onReCaptchaResponse();
                },
                'expired-callback':function(){
                    onRecaptchaExpired();
                }
            });
        }

        //]]>

</script>

<div id="re-captcha-main"></div>

onReCaptchaResponse() and onRecaptchaExpired() are in seperate files, but they don't get ever called, so I didn't share them here.

The thing starts to work back when users disable the chrome://flags/#disable-javascript-harmony-shipping flag. But this serves only as temporary workaround.

There was one error I noticed that was happening in console before the release of new browsers which now disappeared with the new version. And I'm not sure if that had anything to do with this. The error is back there when user disables the mentioned flag. Although, it also works then at the same time.

recaptcha__en.js:191 Uncaught (in promise) TypeError: Iterator value null is not an entry object
    at new Map (<anonymous>)
    at E_.X (recaptcha__en.js:191:71)
    at Array.<anonymous> (recaptcha__en.js:138:3)
    at f.next (recaptcha__en.js:177:55)
    at B (recaptcha__en.js:472:261)

Let me know if anyone is experiancing any similar issues and if anyone has any clue on how to solve this. Thank you!

User clicks on reCaptcha validation checkbox but it just gets stuck spinning forever without the callback being called. It started happening with release of latest chromium 122.

1

There are 1 best solutions below

3
Wilberth Ricardo Garcia Alfaro On

This is caused by google blocking third-party cookies. I have the same problem and I addressed it by adding this Set-Cookie: __Host-name=value;Path=/;Secure;SameSite=None; Partitioned to the response headers following this documentation . But now we have a cycle every time the page loads, loads again and again in an infinite loop. If anyone has solves this, please post the solution.