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

TOKEN_TTL and TOKEN_LIMIT_PER_USER are mutually exclusive? #217

Open
sophiasong93 opened this issue Jul 15, 2020 · 0 comments
Open

TOKEN_TTL and TOKEN_LIMIT_PER_USER are mutually exclusive? #217

sophiasong93 opened this issue Jul 15, 2020 · 0 comments

Comments

@sophiasong93
Copy link

According to the logic in the post() method in https://github.com/James1345/django-rest-knox/blob/develop/knox/views.py
If a user set the TOKEN_LIMIT_PER_USER, the token must have a expiry timestamp greater than current time.

token = request.user.auth_token_set.filter(expiry__gt=now)

However, there could also be a use case where user want to set a non-expiring token with TOKEN_TTL=None, but also have a token limit with TOKEN_LIMIT_PER_USER=X.

Could this be possible?

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