Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how the token expiration is enforced #6

Open
ryandesign opened this issue Nov 8, 2012 · 1 comment
Open

Document how the token expiration is enforced #6

ryandesign opened this issue Nov 8, 2012 · 1 comment

Comments

@ryandesign
Copy link

It seems that the storage engine is responsible for enforcing the token expiration time; this should be documented.

The built-in MemoryStore uses setTimeout() to destroy the token after the expiration time. The Redis example in the readme uses the redis expiration system.

I'm writing a token store using MongoDB, which AFAIK doesn't have automatic expiration of records, so in my lookup method I'll need to ensure that now minus token creation time is less than passReset.expireTimeout(), and I'll need a setInterval() that deletes expired tokens.

@ryandesign
Copy link
Author

I've just learned that mongodb 2.2 and up does have an automatic record expiration feature.

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

No branches or pull requests

1 participant