From 11408c26560dcaf2e7967d8ffc18d6a428595ff3 Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Wed, 4 Feb 2026 21:16:53 -0800 Subject: [PATCH] add internal redirect --- src/app/[orgId]/layout.tsx | 3 ++ src/app/layout.tsx | 2 + src/app/page.tsx | 10 ++++- src/components/ApplyInternalRedirect.tsx | 24 ++++++++++++ src/components/RedirectToOrg.tsx | 24 ++++++++++++ src/components/StoreInternalRedirect.tsx | 27 +++++++++++++ src/lib/internalRedirect.ts | 48 ++++++++++++++++++++++++ 7 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 src/components/ApplyInternalRedirect.tsx create mode 100644 src/components/RedirectToOrg.tsx create mode 100644 src/components/StoreInternalRedirect.tsx create mode 100644 src/lib/internalRedirect.ts diff --git a/src/app/[orgId]/layout.tsx b/src/app/[orgId]/layout.tsx index 7d99fc0d..3d4b6054 100644 --- a/src/app/[orgId]/layout.tsx +++ b/src/app/[orgId]/layout.tsx @@ -18,6 +18,7 @@ import { build } from "@server/build"; import OrgPolicyResult from "@app/components/OrgPolicyResult"; import UserProvider from "@app/providers/UserProvider"; import { Layout } from "@app/components/Layout"; +import ApplyInternalRedirect from "@app/components/ApplyInternalRedirect"; export default async function OrgLayout(props: { children: React.ReactNode; @@ -70,6 +71,7 @@ export default async function OrgLayout(props: { } catch (e) {} return ( + + {props.children} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 203dd778..ed7635e3 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -23,6 +23,7 @@ import Script from "next/script"; import { TanstackQueryProvider } from "@app/components/TanstackQueryProvider"; import { TailwindIndicator } from "@app/components/TailwindIndicator"; import { ViewportHeightFix } from "@app/components/ViewportHeightFix"; +import StoreInternalRedirect from "@app/components/StoreInternalRedirect"; export const metadata: Metadata = { title: `Dashboard - ${process.env.BRANDING_APP_NAME || "Pangolin"}`, @@ -79,6 +80,7 @@ export default async function RootLayout({ return ( + {build === "saas" && (