From 62793e1a9a047493ed9d5f3cec595209b89b6ee3 Mon Sep 17 00:00:00 2001 From: Luan Tran <8613937+luantr@users.noreply.github.com> Date: Wed, 29 Oct 2025 14:26:05 +0100 Subject: [PATCH 1/2] update prod ingress --- nais/nais-prod.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nais/nais-prod.yaml b/nais/nais-prod.yaml index 86506be..f8058fe 100644 --- a/nais/nais-prod.yaml +++ b/nais/nais-prod.yaml @@ -53,7 +53,7 @@ spec: cpu: 200m memory: 256Mi ingresses: - - 'https://www.ekstern.dev.nav.no/syk/kartleggingssporsmal' + - 'https://www.nav.no/syk/kartleggingssporsmal' env: - name: MEROPPFOLGING_BACKEND_URL value: http://meroppfolging-backend From 480f5f10a9f1f4914d1c634976d5b03483fbfb17 Mon Sep 17 00:00:00 2001 From: Luan Tran <8613937+luantr@users.noreply.github.com> Date: Wed, 29 Oct 2025 16:26:31 +0100 Subject: [PATCH 2/2] remove force-dynamic its not necessary anymore after moving call to getEnv() after call to headers(). Now next sees that the route is dynamic and stops rendering the route before the call to getEnv(). --- .env.development.local | 11 ----------- .env.local | 1 + src/app/page.tsx | 2 -- src/services/meroppfolging/meroppfolgingService.ts | 6 +++--- 4 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 .env.development.local create mode 100644 .env.local diff --git a/.env.development.local b/.env.development.local deleted file mode 100644 index b13d656..0000000 --- a/.env.development.local +++ /dev/null @@ -1,11 +0,0 @@ -NEXT_PUBLIC_RUNTIME_ENVIRONMENT=local - -MEROPPFOLGING_BACKEND_URL="dummy-value" -FLEXJAR_BACKEND_HOST="dummy-value" -FLEXJAR_BACKEND_CLIENT_ID="dummy-value" -TOKEN_X_WELL_KNOWN_URL="dummy-value" -TOKEN_X_CLIENT_ID="dummy-value" -TOKEN_X_PRIVATE_JWK="dummy-value" -IDPORTEN_WELL_KNOWN_URL="dummy-value" -IDPORTEN_CLIENT_ID="dummy-value" -NAIS_CLUSTER_NAME="dummy-value" diff --git a/.env.local b/.env.local new file mode 100644 index 0000000..61a5e46 --- /dev/null +++ b/.env.local @@ -0,0 +1 @@ +NEXT_PUBLIC_RUNTIME_ENVIRONMENT=local diff --git a/src/app/page.tsx b/src/app/page.tsx index 8951ebb..c364b2c 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,8 +1,6 @@ import { fetchKandidatStatus } from '@/services/meroppfolging/meroppfolgingService' import KartleggingssporsmalLanding from '@/features/kartleggingssporsmal/KartleggingssporsmalLanding' -export const dynamic = 'force-dynamic' - export default async function Home() { const kandidatStatus = await fetchKandidatStatus() diff --git a/src/services/meroppfolging/meroppfolgingService.ts b/src/services/meroppfolging/meroppfolgingService.ts index 010546e..5938744 100644 --- a/src/services/meroppfolging/meroppfolgingService.ts +++ b/src/services/meroppfolging/meroppfolgingService.ts @@ -18,12 +18,12 @@ export async function fetchKandidatStatus(): Promise { } } - const { MEROPPFOLGING_BACKEND_URL } = getServerEnv() - const url = new URL('/api/v1/kartleggingssporsmal/kandidat-status', MEROPPFOLGING_BACKEND_URL) - const idportenToken = await verifyUserLoggedIn() const exchangedToken = await exchangeIdportenTokenForMeroppfolgingBackendTokenx(idportenToken) + const { MEROPPFOLGING_BACKEND_URL } = getServerEnv() + const url = new URL('/api/v1/kartleggingssporsmal/kandidat-status', MEROPPFOLGING_BACKEND_URL) + try { const res = await fetch(url, { method: 'GET',