mirror of
https://github.com/ae-utbm/sith.git
synced 2025-06-15 15:45:23 +00:00
Forbid authentication with revoked keys
This commit is contained in:
parent
a44cabf861
commit
b8eafaab2c
@ -14,7 +14,7 @@ class ApiKeyAuth(APIKeyHeader):
|
||||
hasher = get_hasher()
|
||||
hashed_key = hasher.encode(key)
|
||||
try:
|
||||
key_obj = ApiKey.objects.get(hashed_key=hashed_key)
|
||||
key_obj = ApiKey.objects.get(revoked=False, hashed_key=hashed_key)
|
||||
except ApiKey.DoesNotExist:
|
||||
return None
|
||||
return key_obj.client
|
||||
|
Loading…
x
Reference in New Issue
Block a user