Open
Description
I'm having a problem with this scenario:
- Load recaptcha
- Load token
<ReCaptcha ref={ref => recaptcha = ref} sitekey={siteKey} action='checkout' verifyCallback={filled}/>
- Submit form with token, captcha validation is ok but some business data are wrong => form shows errors
- User correct data and resubmit => captcha is reused
I'm having some trouble to get a new token with current interface. I'd like to use something
this.recaptcha.execute()
.then(token => /* set new token on request */)
.then(() => api.post(/* new data and new token*/))
or simply a new method that refresh the token with a promise something like
this.recaptcha.refresh() // verify is called again when promise is fulfilled
.then(() => api.post(/* new data */)) // using the refreshed token
What do you think?
Metadata
Metadata
Assignees
Labels
No labels