Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

adding timeout optional field #99

Closed
wants to merge 2 commits into from
Closed

Conversation

foromer4
Copy link

Default stays 2 minutes, but now we can change the timeout

@mtrias
Copy link
Contributor

mtrias commented Jan 12, 2016

This looks like a nice feature to add, but i wonder if it's worth the extra double bind.

Perhaps as in #98 we should add this property to a configuration service ?

Not oposed to it though, it'd be interesting to hear others thoughts

@TheSharpieOne
Copy link
Contributor

WHY? Google has provided a callback which is called when the recaptcha has timed out. We should be using this, not a hardcoded or user defined amount. See #57 which was incorrect closed.

@mtrias
Copy link
Contributor

mtrias commented Jan 12, 2016

I see. I reopened that issue now.

@foromer4
Copy link
Author

Hi , First I agree that it's best to rely on the expiration event of recpatcha-
But...

  1. It is not yet implemented (in angular recaptcha that is).
  2. Even when it will be, there is still room to allow for a custom timeout.
    e.g In our web app, there are calls to several server endpoints. All of them use a common cache for
    recaptcha tokens, so that we can control the timeout ourselves - the client need also to allow changing the timeout.

As for binding vs. config,
if fields like key will also be set in the config than it would of course make sense to do the same
with the timeout.

@TheSharpieOne
Copy link
Contributor

A custom timeout would be setting a timeout to reset the captcha itself.
This timeout only affects the angular form validation (if it is within a
form control) and fires the callback to notify the user/dev that the
captcha response (that token looking thing) is no longer valid. This
doesn't uncheck the box or invalidated the recaptcha response with Google
recaptcha, Google recaptcha does that automatically after 2 mins. The 2 min
hardcoded timeout was a workaround to align with when Google recaptcha
timed out before recaptcha had a timeout callback. As the other tickets
suggests, it should now rely on the callback provided by recaptcha itself.
With the that said, the user/dev should call the reset method in "developer
land" (their own code) after a given time has passed after the success
callback. This is the custom timeout.
Also note, we cannot affect the real timeout of recaptcha itself (as in we
cannot extend it) and would only be able to shorten it by resetting the
instance of the recaptcha widget.

On Tue, Jan 12, 2016, 9:44 AM Omer Schleifer [email protected]
wrote:

Hi , First I agree that it's best to rely on the expiration event, of
recpatcha.
But...

  1. It is not yet implemented.
  2. Even when it will be, there is still room to allow for a custom timeout.
    e.g In our web app, there are calls to several server endpoints. All of
    them use a common cache for
    recaptcha tokens, so that we can control the timeout ourselves - the
    client need also to allow changing the timeout.


Reply to this email directly or view it on GitHub
#99 (comment)
.

@iambrosi
Copy link
Contributor

Timeout is no-longer required since #106 has been merged. Closing now.

@iambrosi iambrosi closed this Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants