var onSubmit = function () {
grecaptcha.execute('@ReCaptchaSiteKey', { action: 'register' }).then(function (token) {
window.document.getElementById('ReCaptchaToken').value = token;
$('form').submit();
});
};
In another words: does the .then() function fire if there was an exception, or is there another undocumented onError() callback that I need to use to submit the form without a token?
Thank you!then(sucessfulCallback: (token: string) => void, failureCallback: (error: Error) => void)): this
but mostly you get `null` in failureCallback parameter, so you are not able to distinguish between network error, or wrong siteKey, or domain not included for siteKey and many other problems. But at least you are notified that something went wrong and you can take an action. Good luck! :)
Ctibor