Description
According to docs, setting the TOKEN_TTL to None will create tokens that never expire.
However, before token creation, when checking that the number active of tokens of a user < token_limit_per_user, tokens without expiry date (expiry=None) are not taken into account.
Description According to docs, setting the
TOKEN_TTL
toNone
will create tokens that never expire.However, before token creation, when checking that the number active of tokens of a user <
token_limit_per_user
, tokens without expiry date (expiry=None
) are not taken into account.https://github.com/James1345/django-rest-knox/blob/3a1bc584f9691f4bc19d8a04a98c68c293be9ca6/knox/views.py#L65
Expected behavior
All active tokens, including the latter, would be expected to be taken into account.
Possible solution
I don't know if I'm misunderstanding something, but a change like the following would suffice.