Skip to content

Commit

Permalink
body
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Jan 22, 2025
1 parent 0d3102b commit efa5887
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion www/routers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ async def profile(
)


class APIKeyRequest(BaseModel):
num_hours: int = 24


class APIKeyResponse(BaseModel):
api_key: str

Expand All @@ -71,7 +75,7 @@ class APIKeyResponse(BaseModel):
async def create_api_key(
user: Annotated[User, Depends(require_user)],
user_info: Annotated[UserInfo, Depends(require_user_info)],
num_hours: Annotated[int, Body(default=24)],
num_hours: Annotated[APIKeyRequest, Body()],
) -> APIKeyResponse:
if num_hours < 1:
raise HTTPException(
Expand Down

0 comments on commit efa5887

Please sign in to comment.