mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
raise roxyErrorTypes.expired_key on expired key
This commit is contained in:
parent
34ff0a7e57
commit
57ced1d25e
1 changed files with 5 additions and 3 deletions
|
@ -753,9 +753,11 @@ async def user_api_key_auth(
|
|||
)
|
||||
if expiry_time < current_time:
|
||||
# Token exists but is expired.
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail=f"Authentication Error - Expired Key. Key Expiry time {expiry_time} and current time {current_time}",
|
||||
raise ProxyException(
|
||||
message=f"Authentication Error - Expired Key. Key Expiry time {expiry_time} and current time {current_time}",
|
||||
type=ProxyErrorTypes.expired_key,
|
||||
code=400,
|
||||
param=api_key,
|
||||
)
|
||||
|
||||
# Check 4. Token Spend is under budget
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue