Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reCAPTCHA fail for second time submit (in version: 1.5.2) #34

Open
level1cr3 opened this issue Feb 16, 2022 · 8 comments
Open

reCAPTCHA fail for second time submit (in version: 1.5.2) #34

level1cr3 opened this issue Feb 16, 2022 · 8 comments

Comments

@level1cr3
Copy link

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:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. 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.

@michaelvs97
Copy link
Owner

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 Adding logging of (mainly) failed reCAPTCHA responses for easier debugging #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.

@level1cr3
Copy link
Author

level1cr3 commented Feb 17, 2022

@michaelvs97

  1. V3 of reCaptcha, latest version of visual studio 2022 and .net 6.

  2. 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.

  3. 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.

@level1cr3
Copy link
Author

@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

@level1cr3
Copy link
Author

@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

@erwintres
Copy link

Hey @level1cr3

Did you manage to resolve this? I'm facing the exact same problem.

@level1cr3
Copy link
Author

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

@SZLMCL
Copy link

SZLMCL commented Sep 19, 2024

Hi, in my case first time when submit the form the rechaptcha validation is good, but there are another (planned) validation problem with another field. I fix the field and click on submit button second time, in this case the rechaptcha validation fails.
I think every request must have a new token, but during ajax call the token not refreshing and cannot use the old token again.

@SZLMCL
Copy link

SZLMCL commented Sep 19, 2024

Finally I found the solution, after the first ajax call must call this existing js function:
updateReCaptcha1()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants