create_user using user_email

This commit is contained in:
Ishaan Jaff 2024-04-19 15:17:50 -07:00
parent 2d353bf284
commit 2a7159c10b
2 changed files with 8 additions and 12 deletions

View file

@ -60,7 +60,7 @@ const Createuser: React.FC<CreateuserProps> = ({ userID, accessToken, teams }) =
message.info("Making API Call"); message.info("Making API Call");
setIsModalVisible(true); setIsModalVisible(true);
console.log("formValues in create user:", formValues); console.log("formValues in create user:", formValues);
const response = await userCreateCall(accessToken, userID, formValues); const response = await userCreateCall(accessToken, null, formValues);
console.log("user create Response:", response); console.log("user create Response:", response);
setApiuser(response["key"]); setApiuser(response["key"]);
message.success("API user Created"); message.success("API user Created");
@ -122,23 +122,19 @@ const Createuser: React.FC<CreateuserProps> = ({ userID, accessToken, teams }) =
</Modal> </Modal>
{apiuser && ( {apiuser && (
<Modal <Modal
title="Save Your User" title="User Created Successfully"
visible={isModalVisible} visible={isModalVisible}
onOk={handleOk} onOk={handleOk}
onCancel={handleCancel} onCancel={handleCancel}
footer={null} footer={null}
> >
<p> <p>
Please save this secret user somewhere safe and accessible. For User has been created to access your proxy. Please Ask them to Log In.
security reasons, <b>you will not be able to view it again</b>{" "}
through your LiteLLM account. If you lose this secret user, you will
need to generate a new one.
</p>
<p>
{apiuser != null
? `API user: ${apiuser}`
: "User being created, this might take 30s"}
</p> </p>
<br></br>
<p><b>Note: This Feature is only supported through SSO on the Admin UI</b></p>
</Modal> </Modal>
)} )}
</div> </div>

View file

@ -158,7 +158,7 @@ export const keyCreateCall = async (
export const userCreateCall = async ( export const userCreateCall = async (
accessToken: string, accessToken: string,
userID: string, userID: string | null,
formValues: Record<string, any> // Assuming formValues is an object formValues: Record<string, any> // Assuming formValues is an object
) => { ) => {
try { try {