Skip to content

Commit f41d0df

Browse files
ashbjleclanche
authored andcommitted
Expire AccessTokens even when REFRESH_TOKEN_EXPIRE_SECONDS is not set (#551)
If refresh tokens are not being used or if REFRESH_TOKEN_EXPIRE_SECONDS is not set in the settings then access tokens are never cleaned up by the `cleartokens` command.
1 parent fd596a0 commit f41d0df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

oauth2_provider/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,5 +389,5 @@ def clear_expired():
389389
with transaction.atomic():
390390
if refresh_expire_at:
391391
refresh_token_model.objects.filter(access_token__expires__lt=refresh_expire_at).delete()
392-
access_token_model.objects.filter(refresh_token__isnull=True, expires__lt=now).delete()
392+
access_token_model.objects.filter(refresh_token__isnull=True, expires__lt=now).delete()
393393
grant_model.objects.filter(expires__lt=now).delete()

0 commit comments

Comments
 (0)