D
D
Dmitry Tarasov2019-10-12 21:22:01
JavaScript
Dmitry Tarasov, 2019-10-12 21:22:01

How to evaluate captcha before page loads?

In general, there are 2 captchas google recaptcha v2 and v3 on the authorization and registration pages.
What is the task?
Initially, when a person enters the site, v3 captcha is launched and a token is generated, which is sent via ajax and a check is made there, if the v3 captcha score is less than 0.3 points, then we must show v2 captcha in the form.
If more than 0.3, we will send the v3 captcha update script to the browser so that when submitting the form there is a new token that we will check after submitting the form.
What is the problem ?
The problem is that when a person enters the site, he immediately presses the button to go immediately, and the token was created and sent via ajax for evaluation, and while the data is going back, the person presses the form submission and sends the same token, and as a result, an error appears.
How to force to quickly evaluate v3 captcha and issue a new token, or v2 captcha before the user has time to press the submit button of the form?
The site has stupidly bare js in places jquery, there is nodejs, that is, I thought about doing it through sockets, but I don’t know how it will work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2019-10-12
@fast-je

Can't you disable the form submit button? Locked up, you write that they are checking and waiting for an answer, if everything is ok, unlocking, if not, the next captcha.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question