AspNetCore.ReCaptcha
AspNetCore.ReCaptcha copied to clipboard
reCAPTCHA fail for second time submit (in version: 1.5.2)
Describe the bug I'm using .net 6 i used previous version everything was fine today(feb 16) i updated the package and when i'm trying to sumbit the form second time i'm getting error. and i'm not able to submit the form. this might be issue on my end as well i'm new to coding so sorry if it is not in your end
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
Hi @level1cr3,
We are going to need more information to properly help you out.
- Which version of reCAPTCHA are you using?
- Is the application throwing an error that second time?
- Is the reCAPTCHA being verified the first time around, and its working fine?
- What do you exactly mean with: 'submitting form second time', was the ModelState invalid, and did you get redirected back to the page to show the validation error?
- Since you are on the latest version of the package, could you turn on trace logging as implemented and mentioned in #32? Please provide the trace log if we need to verify some things.
We checked once more with the example projects, and we couldn't reproduce your issue.
@michaelvs97
-
V3 of reCaptcha, latest version of visual studio 2022 and .net 6.
-
yes(only second time) and this is the error that i can see in google chrome console. what i mean by second time is . i'm filling the form hitting submit the data will get saved. in db but for second when i fill the form and hit submit again it won't save the data.
-
no the reCAPTCHA is not being verified the first time around. for second time it is checking and failing
4
for first submission it's not checking the recaptcha validation.
In debug: modelstate => root key => child node => their is no recaptcha (for first time)
for second time
In debug: modelstate => root key => child node => their is recaptcha key. and when i see error message
modelstate is failing second. because recaptcha is not validated. Your request cannot be completed because you failed Recaptcha verification.
yes modelstate was invalid. no i did not get redicrected i checked error in modelstate by using breakpoint.
@michaelvs97
The last thing you asked i don't know how to get it. I'm sorry man i'm new to programming. what exactly i have to get that if you can tell me step by step
@michaelvs97
did configuration from start again. now validation for Recaptcha is being done in the first submission as well so that's good. But still i don't know why the captcha verification is failing
Hey @level1cr3
Did you manage to resolve this? I'm facing the exact same problem.
Hey @level1cr3
Did you manage to resolve this? I'm facing the exact same problem.
Yes I ended up setting interval in js that will generate new token every 30sec. I don't know if this is the correct way though