diff --git a/apps/scandic-web/.env.local.example b/apps/scandic-web/.env.local.example index b63130ed3..6ff94b5c3 100644 --- a/apps/scandic-web/.env.local.example +++ b/apps/scandic-web/.env.local.example @@ -43,9 +43,9 @@ NODE_OPTIONS="--openssl-legacy-provider" // OPENSSL_MODULES="/var/lang/lib/ossl-modules" to enable legacy encryption support. OPENSSL_MODULES="/var/lang/lib/ossl-modules" -PUBLIC_URL="http://localhost:3000" -AUTH_URL="$PUBLIC_URL/api/web/auth" -NEXTAUTH_URL="$PUBLIC_URL/api/web/auth" +NEXT_PUBLIC_PUBLIC_URL="http://localhost:3000" +AUTH_URL="$NEXT_PUBLIC_PUBLIC_URL/api/web/auth" +NEXTAUTH_URL="$NEXT_PUBLIC_PUBLIC_URL/api/web/auth" GOOGLE_STATIC_MAP_KEY="" GOOGLE_STATIC_MAP_SIGNATURE_SECRET="" diff --git a/apps/scandic-web/.env.test b/apps/scandic-web/.env.test index 4b34ca794..c7d2ae5eb 100644 --- a/apps/scandic-web/.env.test +++ b/apps/scandic-web/.env.test @@ -20,7 +20,7 @@ CYPRESS_CURITY_PASSWORD="test" CYPRESS_BASE_URL="test" DEPLOY_PRIME_URL="test" NEXTAUTH_SECRET="test" -PUBLIC_URL="test" +NEXT_PUBLIC_PUBLIC_URL="test" NEXTAUTH_URL="test" REVALIDATE_SECRET="test" SEAMLESS_LOGIN_DA="test" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Soonest/EmptyUpcomingStays/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Soonest/EmptyUpcomingStays/index.tsx index 42723547e..697748e23 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Soonest/EmptyUpcomingStays/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Soonest/EmptyUpcomingStays/index.tsx @@ -13,9 +13,10 @@ import styles from "./emptyUpcomingStays.module.css" export default async function EmptyUpcomingStaysBlock() { const intl = await getIntl() const lang = getLang() + const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com" const href = env.HIDE_FOR_NEXT_RELEASE - ? getCurrentWebUrl("/", lang) + ? getCurrentWebUrl({ path: "/", lang, baseUrl }) : `/${lang}` return ( diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/EmptyUpcomingStays/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/EmptyUpcomingStays/index.tsx index 42723547e..697748e23 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/EmptyUpcomingStays/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/EmptyUpcomingStays/index.tsx @@ -13,9 +13,10 @@ import styles from "./emptyUpcomingStays.module.css" export default async function EmptyUpcomingStaysBlock() { const intl = await getIntl() const lang = getLang() + const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com" const href = env.HIDE_FOR_NEXT_RELEASE - ? getCurrentWebUrl("/", lang) + ? getCurrentWebUrl({ path: "/", lang, baseUrl }) : `/${lang}` return ( diff --git a/apps/scandic-web/components/Current/Header/MainMenu/index.tsx b/apps/scandic-web/components/Current/Header/MainMenu/index.tsx index 4e84895d8..f6a339e4d 100644 --- a/apps/scandic-web/components/Current/Header/MainMenu/index.tsx +++ b/apps/scandic-web/components/Current/Header/MainMenu/index.tsx @@ -4,9 +4,10 @@ import { usePathname } from "next/navigation" import { useIntl } from "react-intl" -import { findMyBooking } from "@/constants/routes/findMyBooking" +import { findMyBookingCurrentWebPath } from "@/constants/routes/findMyBooking" import { logout } from "@/constants/routes/handleAuth" import { myPages } from "@/constants/routes/myPages" +import { env } from "@/env/client" import useDropdownStore from "@/stores/main-menu" import Image from "@/components/Image" @@ -16,6 +17,7 @@ import SkeletonShimmer from "@/components/SkeletonShimmer" import Link from "@/components/TempDesignSystem/Link" import useLang from "@/hooks/useLang" import { trackClick } from "@/utils/tracking" +import { getCurrentWebUrl } from "@/utils/url" import BookingButton from "../BookingButton" @@ -38,6 +40,7 @@ export function MainMenu({ const intl = useIntl() const lang = useLang() const pathname = usePathname() + const baseUrl = env.NEXT_PUBLIC_PUBLIC_URL || "https://www.scandichotels.com" const isThreeStaticPagesPathnames = [ "/de/sponsoring", @@ -157,7 +160,11 @@ export function MainMenu({