Compare commits

...
Author SHA1 Message Date
William Fu-Hinthorn 8dadeddb35 Update headers type 2025-09-02 19:40:44 -07:00
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ auth = Auth()
@auth.authenticate
async def authenticate(headers: dict) -> Auth.types.MinimalUserDict:
# Validate credentials (e.g., API key, JWT token)
api_key = headers.get("x-api-key")
api_key = headers.get(b"x-api-key")
if not api_key or not is_valid_key(api_key):
raise Auth.exceptions.HTTPException(
status_code=401,
+1 -1
View File
@@ -43,7 +43,7 @@ To leverage custom authentication and access user-level metadata in your deploym
@auth.authenticate # (1)!
async def authenticate(headers: dict) -> Auth.types.MinimalUserDict:
api_key = headers.get("x-api-key")
api_key = headers.get(b"x-api-key")
if not api_key or not is_valid_key(api_key):
raise Auth.exceptions.HTTPException(status_code=401, detail="Invalid API key")