Skip to content

Commit aea40c8

Browse files
authored
Merge pull request #68 from marketing-relevance/refresh-recaptcha-promise
Return promise when refreshing recaptcha token.
2 parents 54bdad6 + 905e926 commit aea40c8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

resources/views/googlerecaptchav3/template.blade.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ function onloadCallback() {
5858

5959
<script {!! $nonce !!}>
6060
function refreshReCaptchaV3(fieldId,action){
61-
grecaptcha.reset(window['client'+fieldId]);
62-
grecaptcha.ready(function () {
63-
grecaptcha.execute(window['client'+fieldId], {
64-
action: action
61+
return new Promise(function (resolve, reject) {
62+
grecaptcha.ready(function () {
63+
grecaptcha.execute(window['client'+fieldId], {
64+
action: action
65+
}).then(resolve);
6566
});
6667
});
6768
}

0 commit comments

Comments
 (0)