mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
fix(page.tsx): route correctly to litellm dashboard from new user login
This commit is contained in:
parent
1c7519f6d7
commit
c8512e57ca
2 changed files with 15 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ import {
|
|||
getOnboardingCredentials,
|
||||
claimOnboardingToken,
|
||||
getUiConfig,
|
||||
getProxyBaseUrl
|
||||
} from "@/components/networking";
|
||||
import { jwtDecode } from "jwt-decode";
|
||||
import { Form, Button as Button2, message } from "antd";
|
||||
|
|
@ -100,7 +101,14 @@ export default function Onboarding() {
|
|||
document.cookie = "token=" + jwtToken;
|
||||
console.log("redirecting to:", litellm_dashboard_ui);
|
||||
|
||||
window.location.href = litellm_dashboard_ui;
|
||||
const proxyBaseUrl = getProxyBaseUrl();
|
||||
console.log("proxyBaseUrl:", proxyBaseUrl);
|
||||
|
||||
if (proxyBaseUrl) {
|
||||
window.location.href = proxyBaseUrl + litellm_dashboard_ui;
|
||||
} else {
|
||||
window.location.href = litellm_dashboard_ui;
|
||||
}
|
||||
});
|
||||
|
||||
// redirect to login page
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { EmailEventSettingsResponse, EmailEventSettingsUpdateRequest } from "./e
|
|||
|
||||
const isLocal = process.env.NODE_ENV === "development";
|
||||
export const defaultProxyBaseUrl = isLocal ? "http://localhost:4000" : null;
|
||||
const defaultServerRootPath = "/";
|
||||
export let serverRootPath = defaultServerRootPath;
|
||||
export let proxyBaseUrl = defaultProxyBaseUrl;
|
||||
if (isLocal != true) {
|
||||
console.log = function() {};
|
||||
|
|
@ -30,6 +32,10 @@ const updateProxyBaseUrl = (serverRootPath: string, receivedProxyBaseUrl: string
|
|||
console.log("Updated proxyBaseUrl:", proxyBaseUrl);
|
||||
};
|
||||
|
||||
const updateServerRootPath = (receivedServerRootPath: string) => {
|
||||
serverRootPath = receivedServerRootPath;
|
||||
};
|
||||
|
||||
export const getProxyBaseUrl = () => {
|
||||
return proxyBaseUrl;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue