Skip to content

Commit

Permalink
Fix API key changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jterry64 committed May 7, 2024
1 parent 8a602d0 commit 97a2ec7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/routes/authentication/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def create_api_key(
Default keys are valid for one year
"""

user_id, user_role = user["id"], user["role"]
user_id, user_role = user.id, user.role

if api_key_data.never_expires and user_role != "ADMIN":
raise HTTPException(
Expand Down Expand Up @@ -124,7 +124,7 @@ async def get_api_key(
User must own API Key or must be Admin to see details.
"""
user_id, role = user["id"], user["role"]
user_id, role = user.id, user.role
try:
row: ORMApiKey = await api_keys.get_api_key(api_key)
except RecordNotFoundError:
Expand All @@ -148,7 +148,7 @@ async def get_api_keys(
Default keys are valid for one year
"""
user_id = user["id"]
user_id = user.id
rows: List[ORMApiKey] = await api_keys.get_api_keys_from_user(user_id)
data = [ApiKey.from_orm(row) for row in rows]

Expand Down Expand Up @@ -191,7 +191,7 @@ async def delete_api_key(
API Key must belong to user.
"""
user_id = user["id"]
user_id = user.id
try:
row: ORMApiKey = await api_keys.get_api_key(api_key)
except RecordNotFoundError:
Expand Down

0 comments on commit 97a2ec7

Please sign in to comment.