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 03dad41 commit e67826c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion oidc_provider/lib/endpoints/token.py
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 e67826c

Please sign in to comment.