Git Product home page Git Product logo

Comments (5)

adamniedzielski avatar adamniedzielski commented on September 7, 2024

Hey @bruno-campos, thanks for the write-up 💚

Yes, the reason for updating last_used_at only if it wasn't updated in the last hour is to prevent extra database requests. Otherwise we will be making a database call on every request, even GET requests, which is quite nasty. I think that having an approximate value in last_used_at is acceptable. This behaviour has been part of this gem since the very beginning.

Expiring tokens were introduced later. I've never considered the case of what happens if expires_in is smaller than 1 hour. You're right - there's a bug in this scenario.

from tiddle.

mattrothstein avatar mattrothstein commented on September 7, 2024

@adamniedzielski Is there any harm in adding an optional configuration like @bruno-campos drafted here? This gives users the plug'n play out of the box experience while also supporting the ability to customize to their use case.

from tiddle.

adamniedzielski avatar adamniedzielski commented on September 7, 2024

I can see that you fixed it for yourself in your fork 👍 👏

from tiddle.

dapx avatar dapx commented on September 7, 2024

@adamniedzielski I am experiencing the same difficult, I have to set 15 minutes of inactive timeout.

Even that it shouldn't be configurable, I believe it should work with short times.

Could we reduce the interval to 1 minute? Or maybe we could have a replaceable default value.

I wouldn't like to create a fork or something like that.

from tiddle.

dapx avatar dapx commented on September 7, 2024

We could add the interval when creating the token as we do with the expires_in, if no value provided, we keep the default behavior.

from tiddle.

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.