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 { GetLicenseStatusResponse } from "@server/routers/license/types"; import { AxiosResponse } from "axios"; import { Metadata } from "next"; import { getTranslations } from "next-intl/server"; import { cache } from "react"; export const metadata: Metadata = { title: `Auth - ${process.env.BRANDING_APP_NAME || "Pangolin"}`, description: "" }; type AuthLayoutProps = { children: React.ReactNode; }; 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; const licenseStatusRes = await cache( async () => await priv.get>( "/license/status" ) )(); const licenseStatus = licenseStatusRes.data.data; return (
{children}
{!( hideFooter || (licenseStatus.isHostLicensed && licenseStatus.isLicenseValid) ) && ( )}
); }