Giter VIP home page Giter VIP logo

Comments (7)

schugabe avatar schugabe commented on July 24, 2024 1

Yes I agree with that

from invisible_captcha.

markets avatar markets commented on July 24, 2024 1

@schugabe New version pushed https://rubygems.org/gems/invisible_captcha/versions/0.9.1 👏 👏

from invisible_captcha.

markets avatar markets commented on July 24, 2024

Thanks for reporting @schugabe.

If I understand you correctly, you want to skip the check during the tests, as you are doing controller testing and timestamp in session isn't set. In that case you are entering this block: https://github.com/markets/invisible_captcha/blob/master/lib/invisible_captcha/controller_ext.rb#L42-L46, am I right?

Outside testing, this check are totally valid...but it make sense to make it "de-activable" per environtment. To achieve that, we have some options:

  1. set InvisibleCaptcha.timestamp_threshold = 0
  2. add a new flag to deactivate the timestamp check (something like InvisibleCaptcha.timestamp_enabled = false)

IMO, option 2, feels probably more clear, what do you think?

from invisible_captcha.

schugabe avatar schugabe commented on July 24, 2024

Yes option 2 would be more clear!

Currently the check in line https://github.com/markets/invisible_captcha/blob/master/lib/invisible_captcha/controller_ext.rb#L43 is done even if InvisibleCaptcha.timestamp_threshold=0
I created a pull request for a test that is currently failing #21

from invisible_captcha.

markets avatar markets commented on July 24, 2024

Hi @schugabe, I'll take a closer look this week, but I think we should move on option 2. What do you propose to fix the failing test in that PR? In my opinion, we just need to introduce this new option to disable the timestamps. Thanks!

from invisible_captcha.

schugabe avatar schugabe commented on July 24, 2024

I also prefer an dedicated option to disable this check completely. This would also fix the failing test.
So option 2 is the way to go 👍

from invisible_captcha.

markets avatar markets commented on July 24, 2024

ok @schugabe, but in that case, we don't need to support timestamp_threshold = 0 to disable this check. Semantically, it's correct, "wait 0 seconds" is going to fail always... so the test will be written using the new flag timestamp_enabled = false.

Are you agree with that? (If yes, we can close that PR #21 and rename this issue to something like: "Allow to disable the timestamp check")

from invisible_captcha.

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.