Closed mfrachet closed 8 years ago
I have the same issue. Any luck ?
Did #81 not fix this for you?
Chances are, you are loading/creating a recaptcha instance more than once. To check this, do the following:
In your javascript console, when this happens, what is the value returned when you enter ___grecaptcha_cfg.count
?
If the value returned is greater than 0
, then you have created more than one instance, and chances are, the first one is no longer there anymore and calling it without passing a wigetId
attempts to get the first one. In that case, you must call vcRecaptchaService.getResponse(widgetId)
with the widgetId for the one you want to get the response from. Use the onCreate callback to get the widgetId.
Or use on-success
I use only one recaptcha at a time.
It seems that using the on-success attribute on HTML element made the thing work. Gonna investiguate if something was on my side or make a PR if I get something on the lib.
Thank you for the job
You may only have one, but it probably gets rendered multiple times (even without you knowing it). For instance, if you navigate to a page which has a captcha, then navigate to a different page, then go back to the page with the captcha. It's one page with one captcha, but it was rendered multiple times. Since the page never really reloads, the recaptcha counter Google uses to identify specific instances goes up.
Also, I have seen a few times where the view is rendered multiple times without navigation, causing the counter to go up.
if ___grecaptcha_cfg.count
is greater than 0
(0
being the first ID, meaning there is 1), then you have rendered it more than once.
I solved my problem using vcRecaptchaService.getResponse(widgetId). thanks @TheSharpieOne
I'm closing this issue as appears to be resolved. Reopen otherwise.
I m actually having an error, and I don't know how to make it work. I m using version 2.2.5 and angular 1.4.2.
Actually, when I validate and loggin my application for the first time, it works great, I m well redirected.
After some navigation inside of my app, I need to disconnect the user account. So I redirect the user to the login page (where I use the recaptcha verification) and after the re-login step, I have this error :
I tried to use the reload() function when logout, but it doesn't seem to work.
What can I do ? Is this a bug ?
EDIT : It seems that my problem is on getResponse() of the recaptcha service :
I can log the step one, and then it crashes