Skip to content

TOKEN_TTL and TOKEN_LIMIT_PER_USER are mutually exclusive? #217

@sophiasong93

Description

@sophiasong93

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions