Skip to content

Commit 1e5f87f

Browse files
authored
Refresh token before expiration (#13)
Since the token expires after 2 minutes I recommend adding a call a bit before the expiration to refresh the token.
1 parent 87ebb27 commit 1e5f87f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Resources/views/Form/karser_recaptcha3_widget.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
grecaptcha.execute('{{ form.vars.site_key }}', {action: '{{ form.vars.action_name }}'}).then(function(token) {
1010
document.getElementById('{{ id }}').value = token;
1111
});
12+
setTimeout(recaptchaCallback_{{ id }}, 100000);
1213
};
1314
</script>
1415
<script src="https://www.google.com/recaptcha/api.js?render={{ form.vars.site_key }}&onload=recaptchaCallback_{{ id }}" async defer></script>

0 commit comments

Comments
 (0)