Skip to content

Commit

Permalink
Merge pull request #68 from marketing-relevance/refresh-recaptcha-pro…
Browse files Browse the repository at this point in the history
…mise

Return promise when refreshing recaptcha token.
  • Loading branch information
RyanDaDeng authored Jul 14, 2020
2 parents 54bdad6 + 905e926 commit aea40c8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions resources/views/googlerecaptchav3/template.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ function onloadCallback() {

<script {!! $nonce !!}>
function refreshReCaptchaV3(fieldId,action){
grecaptcha.reset(window['client'+fieldId]);
grecaptcha.ready(function () {
grecaptcha.execute(window['client'+fieldId], {
action: action
return new Promise(function (resolve, reject) {
grecaptcha.ready(function () {
grecaptcha.execute(window['client'+fieldId], {
action: action
}).then(resolve);
});
});
}
Expand Down

0 comments on commit aea40c8

Please sign in to comment.