From df7b8ca7dd3d56c6343931eda2d46ac6b02b4372 Mon Sep 17 00:00:00 2001 From: "Chuma Mcphoy (We Ahead)" Date: Thu, 3 Jul 2025 13:23:32 +0000 Subject: [PATCH] Merged in fix/use-image-component-for-dtmc-link-error (pull request #2515) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use component image for dtmc error page bg * Use component image for dtmc error page bg Approved-by: Joakim Jäderberg Approved-by: Anton Gunnarsson Approved-by: Matilda Landström --- .../scandic-web/app/[lang]/(live)/(public)/dtmc/route.ts | 9 +++++---- .../(protected)/link-employment-error/page.tsx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/dtmc/route.ts b/apps/scandic-web/app/[lang]/(live)/(public)/dtmc/route.ts index 8de89273b..ee75799f1 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/dtmc/route.ts +++ b/apps/scandic-web/app/[lang]/(live)/(public)/dtmc/route.ts @@ -1,20 +1,21 @@ -import { NextResponse } from "next/server" +import { type NextRequest, NextResponse } from "next/server" import { AuthError } from "next-auth" import { logger } from "@scandic-hotels/common/logger" import { dtmcApiCallback } from "@/constants/routes/dtmc" -import { env } from "@/env/server" import { internalServerError, serviceUnavailable } from "@/server/errors/next" +import { getPublicURL } from "@/server/utils" import { signIn } from "@/auth.dtmc" -export async function GET() { +export async function GET(request: NextRequest) { + const publicURL = getPublicURL(request) try { const redirectUrl = await signIn( "microsoft-entra-id", { - redirectTo: `${env.PUBLIC_URL}${dtmcApiCallback}`, + redirectTo: `${publicURL}${dtmcApiCallback}`, redirect: false, }, { diff --git a/apps/scandic-web/app/[lang]/(no-layout)/(protected)/link-employment-error/page.tsx b/apps/scandic-web/app/[lang]/(no-layout)/(protected)/link-employment-error/page.tsx index a27a6a700..9731f9dbd 100644 --- a/apps/scandic-web/app/[lang]/(no-layout)/(protected)/link-employment-error/page.tsx +++ b/apps/scandic-web/app/[lang]/(no-layout)/(protected)/link-employment-error/page.tsx @@ -1,6 +1,5 @@ "use client" -import Image from "next/image" import { useSearchParams } from "next/navigation" import { type IntlShape, useIntl } from "react-intl" @@ -12,6 +11,7 @@ import { supportEmail, supportPhone } from "@/constants/contactSupport" import { employeeBenefits } from "@/constants/routes/dtmc" import ButtonLink from "@/components/ButtonLink" +import Image from "@/components/Image" import Link from "@/components/TempDesignSystem/Link" import useLang from "@/hooks/useLang" import background from "@/public/_static/img/Scandic_Computer_Coffee.png"