Skip to content

Commit 40dc5a0

Browse files
committed
Debugging
1 parent 2002179 commit 40dc5a0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/core/security.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,13 @@ async def verify_token(request: Request, credentials: Optional[HTTPAuthorization
126126
}
127127

128128
# Verify key hasn't been removed
129-
key = db.table('api_keys').select('*').eq('key_id', decoded["key_id"]).maybe_single().execute()
129+
results = db.table('api_keys').select('*').eq('key_id', decoded["key_id"]).execute()
130+
print("Query results:", results.data)
131+
if results.data:
132+
key = results.data[0]
133+
print("Key data:", key)
134+
key_using_maybe_results = results.maybe_single()
135+
print("Key using maybe:", key_using_maybe_results)
130136
if not key:
131137
raise HTTPException(status_code=401, detail="API key not found (it may have been removed)")
132138
else:

0 commit comments

Comments
 (0)