MCPcopy Create free account
hub / github.com/authlib/authlib / query_authorization_code

Method query_authorization_code

tests/django/test_oauth2/models.py:127–134  ·  view source on GitHub ↗
(self, code, client)

Source from the content-addressed store, hash-verified

125
126class CodeGrantMixin:
127 def query_authorization_code(self, code, client):
128 try:
129 item = OAuth2Code.objects.get(code=code, client_id=client.client_id)
130 except OAuth2Code.DoesNotExist:
131 return None
132
133 if not item.is_expired():
134 return item
135
136 def delete_authorization_code(self, authorization_code):
137 authorization_code.delete()

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
is_expiredMethod · 0.45

Tested by

no test coverage detected