Skip to content

Commit

Permalink
Update token.py
Browse files Browse the repository at this point in the history
  • Loading branch information
juanifioren committed Sep 23, 2023
1 parent 7d186ee commit 34408af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion oidc_provider/lib/endpoints/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def validate_params(self):
raise TokenError('invalid_client')

try:
self.code = Code.objects.select_for_update(nowait=True).get(code=self.params['code'])
self.code = Code.objects.select_for_update(nowait=True).get(
code=self.params['code'])
except DatabaseError:
logger.debug('[Token] Code cannot be reused: %s', self.params['code'])
raise TokenError('invalid_grant')
Expand Down

0 comments on commit 34408af

Please sign in to comment.