mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
Merge pull request #4164 from BerriAI/litellm_fix_error_inernal_users_sso_saw
[Admin UI] Fix error Internal Users see when using SSO
This commit is contained in:
commit
4fc16a6bec
4 changed files with 4 additions and 2 deletions
|
|
@ -224,6 +224,7 @@ class LiteLLMRoutes(enum.Enum):
|
|||
"/key/delete",
|
||||
"/global/spend/logs",
|
||||
"/global/predict/spend/logs",
|
||||
"/sso/get/logout_url",
|
||||
]
|
||||
|
||||
management_routes: List = [ # key
|
||||
|
|
|
|||
|
|
@ -879,6 +879,7 @@ async def user_api_key_auth(
|
|||
|
||||
## check for cache hit (In-Memory Cache)
|
||||
original_api_key = api_key # (Patch: For DynamoDB Backwards Compatibility)
|
||||
_user_role = None
|
||||
if api_key.startswith("sk-"):
|
||||
api_key = hash_token(token=api_key)
|
||||
valid_token: Optional[UserAPIKeyAuth] = user_api_key_cache.get_cache( # type: ignore
|
||||
|
|
@ -1512,7 +1513,7 @@ async def user_api_key_auth(
|
|||
):
|
||||
return UserAPIKeyAuth(
|
||||
api_key=api_key,
|
||||
user_role="app_owner",
|
||||
user_role=_user_role,
|
||||
parent_otel_span=parent_otel_span,
|
||||
**valid_token_dict,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -3618,6 +3618,7 @@ class Router:
|
|||
except Exception:
|
||||
model_info = None
|
||||
# get llm provider
|
||||
model, llm_provider = "", ""
|
||||
try:
|
||||
model, llm_provider, _, _ = litellm.get_llm_provider(
|
||||
model=litellm_params.model,
|
||||
|
|
|
|||
|
|
@ -2405,7 +2405,6 @@ export const getProxyBaseUrlAndLogoutUrl = async (
|
|||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.text();
|
||||
message.error(errorData, 10);
|
||||
throw new Error("Network response was not ok");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue