GithubHelp home page GithubHelp logo

Comments (7)

DethAriel avatar DethAriel commented on July 27, 2024

I will post various scenarios below:

  • User solved recaptcha, then recaptcha expires. Expected result: there is a (resolved) event
  • User did not solve recaptcha, then recaptcha expires. Expected result: there is no (resolved) event

Can you clarify which of the cases does not work, please? Just so you know, it's not the lib who controls whether we reset the captcha after expiration - it's the recaptcha itself that gets reset. So you cannot avoid automatic captcha reset after it has expired.

from ng-recaptcha.

rdrenker avatar rdrenker commented on July 27, 2024

In my specific scenario, I solved the recaptcha, then sat around and waited for it to expire - so the first scenario. I have not tested the second scenario (and actually, I didn't even realize an unsolved recaptcha could expire).

Regarding your statement "it's the recaptcha itself that gets reset" - you are absolutely correct, however when this happens it shows the following text within the widget: "Verification expired. Check the checkbox again."; this is kind of nice as it provides a bit of feedback to the user as to why the recaptcha was reset. Conversely, calling the reset() method exposed by the component completely resets the recaptcha, and this info message is lost.

from ng-recaptcha.

DethAriel avatar DethAriel commented on July 27, 2024

So the real issue here is that "Verification expired. Check the checkbox again." message is lost, am I getting this right?

from ng-recaptcha.

DethAriel avatar DethAriel commented on July 27, 2024

With regards to my second scenario - yeah, that's probably not what's happening, something must have messed up my mind

from ng-recaptcha.

rdrenker avatar rdrenker commented on July 27, 2024

No - that's just a nicety - the real issue is that the response event is never fired, which means i don't know that the recaptcha is no longer valid.

So take this sample code for instance:

resolved(recaptchaResponse: string) {
    this.criteria.recaptchaResponse = recaptchaResponse;
}

So when I first solve the recaptcha, my criteria object gets the big long recaptcha data string. When I sit around for a bit, the recaptcha expires, but the resolved() event is not fired, so I'm not being notified that I need to clear out that value from my criteria object.

From my investigation, its not being fired because the following code

this.grecaptcha.getResponse(this.widget)

within the reset() method is returning an empty string

from ng-recaptcha.

DethAriel avatar DethAriel commented on July 27, 2024

please update to v1.5.3

from ng-recaptcha.

rdrenker avatar rdrenker commented on July 27, 2024

Works like a charm!

from ng-recaptcha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.