From 05aefe18ce74630ca4f0b0fccf78ad97c00ce95d Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 10 Apr 2024 13:33:32 -0700 Subject: [PATCH 1/2] ui - set admin when setting up sso --- ui/litellm-dashboard/src/components/admins.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ui/litellm-dashboard/src/components/admins.tsx b/ui/litellm-dashboard/src/components/admins.tsx index 926df9b87cb..cff4ca2b875 100644 --- a/ui/litellm-dashboard/src/components/admins.tsx +++ b/ui/litellm-dashboard/src/components/admins.tsx @@ -61,6 +61,7 @@ const AdminPanel: React.FC = ({ const [isInstructionsModalVisible, setIsInstructionsModalVisible] = useState(false); const handleAddSSOOk = () => { + setIsAddSSOModalVisible(false); form.resetFields(); }; @@ -71,10 +72,11 @@ const handleAddSSOCancel = () => { }; const handleShowInstructions = (formValues: Record) => { + handleAdminCreate(formValues); + handleSSOUpdate(formValues); setIsAddSSOModalVisible(false); setIsInstructionsModalVisible(true); // Optionally, you can call handleSSOUpdate here with the formValues - // handleSSOUpdate(formValues); }; const handleInstructionsOk = () => { @@ -439,10 +441,17 @@ const handleInstructionsCancel = () => { labelAlign="left" > <> + + + @@ -450,7 +459,7 @@ const handleInstructionsCancel = () => { @@ -458,7 +467,7 @@ const handleInstructionsCancel = () => { From 195840b761ae6c79d69fb0427f7e4e80b2c56fde Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 10 Apr 2024 13:34:22 -0700 Subject: [PATCH 2/2] fix - error user not allowed to access info --- litellm/proxy/proxy_server.py | 1 + 1 file changed, 1 insertion(+) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 6416044d8ca..4e7ef416e9d 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -7925,6 +7925,7 @@ async def auth_callback(request: Request): "models": getattr(user_info, "models", []), "user_id": getattr(user_info, "user_id", user_id), "user_email": getattr(user_info, "user_id", user_email), + "user_role": getattr(user_info, "user_role", None), } user_role = getattr(user_info, "user_role", None)