RyanDaDeng / laravel-google-recaptcha-v3

It's probably the best Laravel Package for Google reCAPTCHA v3. Vue component supported.
MIT License
275 stars 40 forks source link

Return promise when refreshing recaptcha token. #68

Closed ericp-mrel closed 4 years ago

ericp-mrel commented 4 years ago

This PR returns a promise when calling the refreshReCaptchaV3 function, this enables use cases such as refreshing the token when a user submits a form to avoid token timeouts if a user has not filled out the form within two minutes of loading a page. Then once the token has been refreshed, you can be notified and resume the ajax form submission request.

I have also removed the rest function call as it is not needed and causes execution to take longer since it has to re-initialize the entire widget instead of just refreshing the token.