From 9e36a1fa7cd8517d3968c5f3a3745d95a5724afe Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Wed, 29 Nov 2023 19:35:50 +0700 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Only=20force=20dynamic=20r?= =?UTF-8?q?ender=20for=20self-hosted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/app/[locale]/(auth)/login/page.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/[locale]/(auth)/login/page.tsx b/apps/web/src/app/[locale]/(auth)/login/page.tsx index 32f74e626..02777985d 100644 --- a/apps/web/src/app/[locale]/(auth)/login/page.tsx +++ b/apps/web/src/app/[locale]/(auth)/login/page.tsx @@ -5,9 +5,11 @@ import { LoginForm } from "@/app/[locale]/(auth)/login/login-form"; import { Params } from "@/app/[locale]/types"; import { getTranslation } from "@/app/i18n"; import { AuthCard } from "@/components/auth/auth-layout"; -import { isOIDCEnabled, oidcName } from "@/utils/constants"; +import { isOIDCEnabled, isSelfHosted, oidcName } from "@/utils/constants"; -export const dynamic = "force-dynamic"; +// Self-hosted instances only have env vars for OIDC at runtime, so we need to +// use force-dynamic to avoid statically rendering this page during build time.. +export const dynamic = isSelfHosted ? "force-dynamic" : "auto"; export default async function LoginPage({ params }: { params: Params }) { const { t } = await getTranslation(params.locale);