From 6da81b38178ea4a3ee2fe069918c9f0ab661ca3e Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 3 Nov 2025 17:33:50 -0800 Subject: [PATCH] Fix bad request in non-enterprise --- src/app/auth/layout.tsx | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/app/auth/layout.tsx b/src/app/auth/layout.tsx index 9b6eaaab..378b62ee 100644 --- a/src/app/auth/layout.tsx +++ b/src/app/auth/layout.tsx @@ -1,8 +1,8 @@ import ThemeSwitcher from "@app/components/ThemeSwitcher"; import { Separator } from "@app/components/ui/separator"; import { priv } from "@app/lib/api"; -import { verifySession } from "@app/lib/auth/verifySession"; import { pullEnv } from "@app/lib/pullEnv"; +import { build } from "@server/build"; import { GetLicenseStatusResponse } from "@server/routers/license/types"; import { AxiosResponse } from "axios"; import { Metadata } from "next"; @@ -19,19 +19,25 @@ type AuthLayoutProps = { }; export default async function AuthLayout({ children }: AuthLayoutProps) { - const getUser = cache(verifySession); const env = pullEnv(); - const user = await getUser(); const t = await getTranslations(); - const hideFooter = env.branding.hideAuthLayoutFooter || false; + let hideFooter = false; - const licenseStatusRes = await cache( - async () => - await priv.get>( - "/license/status" - ) - )(); - const licenseStatus = licenseStatusRes.data.data; + if (build == "enterprise") { + const licenseStatusRes = await cache( + async () => + await priv.get>( + "/license/status" + ) + )(); + if ( + env.branding.hideAuthLayoutFooter && + licenseStatusRes.data.data.isHostLicensed && + licenseStatusRes.data.data.isLicenseValid + ) { + hideFooter = true; + } + } return (
@@ -43,10 +49,7 @@ export default async function AuthLayout({ children }: AuthLayoutProps) {
{children}
- {!( - hideFooter || - (licenseStatus.isHostLicensed && licenseStatus.isLicenseValid) - ) && ( + {!hideFooter && (