Skip to content

Commit

Permalink
Fix fetching old access_token from refresh_token
Browse files Browse the repository at this point in the history
  • Loading branch information
scaredcat authored and Asif Saif Uddin committed Mar 16, 2020
1 parent b4aa49f commit 6b2f5f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion oauth2_provider/oauth2_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,9 @@ def validate_refresh_token(self, refresh_token, client, request, *args, **kwargs
seconds=oauth2_settings.REFRESH_TOKEN_GRACE_PERIOD_SECONDS
)
)
rt = RefreshToken.objects.filter(null_or_recent, token=refresh_token).first()
rt = RefreshToken.objects.filter(null_or_recent, token=refresh_token).select_related(
"access_token"
).first()

if not rt:
return False
Expand Down

0 comments on commit 6b2f5f8

Please sign in to comment.