mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
fix(page.tsx): call credential endpoint once ui config is loaded
This commit is contained in:
parent
36f18411d0
commit
1c7519f6d7
2 changed files with 4 additions and 3 deletions
|
|
@ -67,7 +67,7 @@ export default function Onboarding() {
|
|||
const user_id = decoded.user_id;
|
||||
setUserID(user_id);
|
||||
});
|
||||
}, [inviteID]);
|
||||
}, [inviteID, getUiConfigLoading]);
|
||||
|
||||
const handleSubmit = (formValues: Record<string, any>) => {
|
||||
console.log(
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ import { UserInfo } from "./view_users/types";
|
|||
import { EmailEventSettingsResponse, EmailEventSettingsUpdateRequest } from "./email_events/types";
|
||||
|
||||
const isLocal = process.env.NODE_ENV === "development";
|
||||
export let proxyBaseUrl = isLocal ? "http://localhost:4000" : null;
|
||||
export const defaultProxyBaseUrl = isLocal ? "http://localhost:4000" : null;
|
||||
export let proxyBaseUrl = defaultProxyBaseUrl;
|
||||
if (isLocal != true) {
|
||||
console.log = function() {};
|
||||
}
|
||||
|
|
@ -122,7 +123,7 @@ export function setGlobalLitellmHeaderName(headerName: string = "Authorization")
|
|||
export const getUiConfig = async () => {
|
||||
console.log("Getting UI config");
|
||||
/**Special route to get the proxy base url and server root path */
|
||||
const url = `${proxyBaseUrl}/litellm/.well-known/litellm-ui-config`;
|
||||
const url = defaultProxyBaseUrl ? `${defaultProxyBaseUrl}/litellm/.well-known/litellm-ui-config` : `/litellm/.well-known/litellm-ui-config`;
|
||||
const response = await fetch(url);
|
||||
const jsonData: LiteLLMWellKnownUiConfig = await response.json();
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue