fix(page.tsx): route correctly to litellm dashboard from new user login

This commit is contained in:
Krrish Dholakia 2025-06-02 15:47:11 -07:00
parent 1c7519f6d7
commit c8512e57ca
2 changed files with 15 additions and 1 deletions

View file

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

View file

@ -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;
};