From 8d7f3a50d1bef78cdc8d13cb6e6a28ce47764bf9 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Tue, 29 Jul 2025 13:57:41 -0700 Subject: [PATCH] fix(domain): add redirects to maintain API routes with old host (#820) * fix(domain): add redirects to maintain API routes with old host * fix RB2B --------- Co-authored-by: waleedlatif --- apps/sim/app/layout.tsx | 5 +++-- apps/sim/lib/env.ts | 4 ++++ apps/sim/lib/security/csp.ts | 1 + apps/sim/next.config.ts | 16 ++++++++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/layout.tsx b/apps/sim/app/layout.tsx index ed2921203e..a7c424d760 100644 --- a/apps/sim/app/layout.tsx +++ b/apps/sim/app/layout.tsx @@ -2,6 +2,7 @@ import { Analytics } from '@vercel/analytics/next' import { SpeedInsights } from '@vercel/speed-insights/next' import type { Metadata, Viewport } from 'next' import { PublicEnvScript } from 'next-runtime-env' +import { env } from '@/lib/env' import { isHosted } from '@/lib/environment' import { createLogger } from '@/lib/logs/console/logger' import { getAssetUrl } from '@/lib/utils' @@ -225,10 +226,10 @@ export default function RootLayout({ children }: { children: React.ReactNode }) {/* RB2B Script - Only load on hosted version */} - {isHosted && ( + {isHosted && env.NEXT_PUBLIC_RB2B_KEY && (