Merge pull request #2939 from BerriAI/litellm_fix_error_ui_sso

[UI] Fix SSO Error - user not allowed to access info
This commit is contained in:
Ishaan Jaff 2024-04-10 13:36:33 -07:00 • committed by GitHub
commit c662b5557c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View file

@ -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)

View file

@ -61,6 +61,7 @@ const AdminPanel: React.FC<AdminPanelProps> = ({
const [isInstructionsModalVisible, setIsInstructionsModalVisible] = useState(false);
const handleAddSSOOk = () => {
setIsAddSSOModalVisible(false);
form.resetFields();
};
@ -71,10 +72,11 @@ const handleAddSSOCancel = () => {
};
const handleShowInstructions = (formValues: Record<string, any>) => {
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"
>
<>
<Form.Item
label="Admin Email"
name="user_email"
rules={[{ required: true, message: "Please enter the email of the proxy admin" }]}
>
<Input />
</Form.Item>
<Form.Item
label="PROXY BASE URL"
name="proxy_base_url"
rules={[{ required: true, message: "Please enter the public key" }]}
rules={[{ required: true, message: "Please enter the proxy base url" }]}
>
<Input />
</Form.Item>
@ -450,7 +459,7 @@ const handleInstructionsCancel = () => {
<Form.Item
label="GOOGLE CLIENT ID"
name="google_client_id"
rules={[{ required: true, message: "Please enter the public key" }]}
rules={[{ required: true, message: "Please enter the google client id" }]}
>
<Input.Password />
</Form.Item>
@ -458,7 +467,7 @@ const handleInstructionsCancel = () => {
<Form.Item
label="GOOGLE CLIENT SECRET"
name="google_client_secret"
rules={[{ required: true, message: "Please enter the private key" }]}
rules={[{ required: true, message: "Please enter the google client secret" }]}
>
<Input.Password />
</Form.Item>