mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +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:
|
if expiry_time < current_time:
|
||||||
# Token exists but is expired.
|
# Token exists but is expired.
|
||||||
raise HTTPException(
|
raise ProxyException(
|
||||||
status_code=status.HTTP_403_FORBIDDEN,
|
message=f"Authentication Error - Expired Key. Key Expiry time {expiry_time} and current time {current_time}",
|
||||||
detail=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
|
# Check 4. Token Spend is under budget
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue