fix: remove rewrites() from next.config.mjs (incompatible with output: export), fix OAuth field paths

This commit is contained in:
Ishaan Jaffer 2026-03-09 20:42:02 -07:00
parent c46c8b5962
commit 50f510d8f6
2 changed files with 2 additions and 67 deletions

View file

@ -5,8 +5,6 @@ import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const DEV_PROXY_TARGET = process.env.LITELLM_BACKEND_URL || "http://localhost:4000";
const nextConfig = {
output: "export",
basePath: "",
@ -15,67 +13,6 @@ const nextConfig = {
// Must be absolute; "." is no longer allowed
root: __dirname,
},
// Dev-only: proxy API calls to the litellm backend to avoid CORS issues
async rewrites() {
return [
{
source: "/v1/:path*",
destination: `${DEV_PROXY_TARGET}/v1/:path*`,
},
{
source: "/v2/:path*",
destination: `${DEV_PROXY_TARGET}/v2/:path*`,
},
{
source: "/key/:path*",
destination: `${DEV_PROXY_TARGET}/key/:path*`,
},
{
source: "/team/:path*",
destination: `${DEV_PROXY_TARGET}/team/:path*`,
},
{
source: "/user/:path*",
destination: `${DEV_PROXY_TARGET}/user/:path*`,
},
{
source: "/model/:path*",
destination: `${DEV_PROXY_TARGET}/model/:path*`,
},
{
source: "/health/:path*",
destination: `${DEV_PROXY_TARGET}/health/:path*`,
},
{
source: "/callbacks/:path*",
destination: `${DEV_PROXY_TARGET}/callbacks/:path*`,
},
{
source: "/config/:path*",
destination: `${DEV_PROXY_TARGET}/config/:path*`,
},
{
source: "/mcp-rest/:path*",
destination: `${DEV_PROXY_TARGET}/mcp-rest/:path*`,
},
{
source: "/sso/:path*",
destination: `${DEV_PROXY_TARGET}/sso/:path*`,
},
{
source: "/.well-known/:path*",
destination: `${DEV_PROXY_TARGET}/.well-known/:path*`,
},
{
source: "/litellm/.well-known/:path*",
destination: `${DEV_PROXY_TARGET}/litellm/.well-known/:path*`,
},
{
source: "/in_product_nudges",
destination: `${DEV_PROXY_TARGET}/in_product_nudges`,
},
];
},
};
export default nextConfig;

View file

@ -35,10 +35,8 @@ const OpenAPIFormSection: React.FC<OpenAPIFormSectionProps> = ({
};
if (entry.oauth) {
updates.auth_type = AUTH_TYPE.OAUTH2;
updates.credentials = {
authorization_url: entry.oauth.authorization_url,
token_url: entry.oauth.token_url,
};
updates.authorization_url = entry.oauth.authorization_url;
updates.token_url = entry.oauth.token_url;
}
form.setFieldsValue(updates);
onValuesChange(updates);