Skip to content

Conversation

iamthearvin
Copy link

Hi @JamesRitchie ,

I was able to use your work in one of the APIs I'm working on. That saved me a lot of time. Thanks a lot. I had to customize it a bit though as I couldn't allow the token to be valid for days. I introduced sliding token expiration. Yes, much like how sessions are handled in typical web applications. The thing is I'm creating an API that is mobile-ready but can also double as a web application backend.

Basically, if the token expires but a request makes it to the slide window, the token's creation time is set to the current time thereby extending the life span of the same token by another X minutes or so depending on the life span setting. Of course, you already know how this works. (:

Aside from the primary sources, I updated the tests, and a handful of lines in the README file. It could use a code review and an optimization though. Feel free to do whatever you want with this now.

Thanks!

- Added configurable sliding expiration to tokens.
- Updated tests to include testing of additional feature.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling fa9b91f on iamthearvin:sliding_expiration into e62f1f9 on JamesRitchie:master.

1 similar comment
@coveralls
Copy link

coveralls commented Dec 29, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling fa9b91f on iamthearvin:sliding_expiration into e62f1f9 on JamesRitchie:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants