var grecaptcha_execute = function(){
    grecaptcha.execute('{{ public_key }}', {action: '{{ action_name }}'}).then(function(token) {
        document.querySelectorAll('input.django-recaptcha-hidden-field').forEach(function (value) {
            value.value = token;
        });
        return token;
    })
};
grecaptcha_execute()
setInterval(grecaptcha_execute, 120000);
{% if custom_callback %}.then(function(token) {
    window["{{ custom_callback }}"](token);
}){% endif %}
