Is it possible for grecaptcha.enterprise.execute to return empty or null values?

We have successfully integrated Google reCAPTCHA Enterprise into our site, and it functions perfectly when I fill out and submit the form. However, our logs reveal numerous error messages indicating that requests are missing the required non-empty reCAPTCHA token parameter.

Upon investigation, it appears that many of these errors are likely due to bot-like behavior, as we observe that the form is often submitted within just 1-2 seconds after the page is loaded. However, we also encounter cases where the issue does not seem to stem from automated scripts. In these instances, the form submission occurs after a reasonable period, suggesting that the issue might not be solely related to rapid submissions.

We have implemented Google reCAPTCHA Enterprise on our site by including the following script in the section of our HTML:

<script src="https://www.google.com/recaptcha/enterprise.js?render=SITE_KEY"></script>

On the frontend, we use a submitForm function to retrieve the reCAPTCHA token and submit the form data to our backend. The submitForm function is defined as follows:


function submitForm(form, url, siteKey) {
    // Display a loading spinner or similar indicator
    grecaptcha.enterprise.ready(async () => {
        const token = await grecaptcha.enterprise.execute(siteKey, { action: 'submit' });
        
        // Perform additional processing for complex inputs
        const searchParams = new URLSearchParams();
        searchParams.append('g-recaptcha-response', token);
        
        // Submit the form data via a POST request
        fetch(url, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            body: searchParams.toString(),
        })
        .then((response) => {
            // Handle the response from the server
            ...
        });

In this implementation, the fetch request is only executed after grecaptcha.enterprise.ready and await grecaptcha.enterprise.execute. Therefore, the token should be obtained before the POST request is made. However, if the token is empty, it could be due to Google returning an empty value or if the request is being sent manually, bypassing this JavaScript code.

My question is: Can grecaptcha.enterprise.execute return empty or null values?
If so, in which cases tokens can be empty? How should we correctly handle it? Is it safe to check the token in FE side before sending a POST request?
If not, is it something with our implementation? Why might it work in some cases but not in others?

I reviewed Google’s documentation on reCAPTCHA but couldn’t find relevant information about my question. Additionally, I checked the reCAPTCHA logs for incoming token requests, but it seems that only assessment requests are being logged.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật