From b84099aec0b11725839a135804aed4eb453420d5 Mon Sep 17 00:00:00 2001 From: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Date: Fri, 13 Sep 2024 19:14:33 +0100 Subject: [PATCH] fix: use correct redirect url for google oauth when using overlay calendar (#16623) --- packages/platform/atoms/booker/BookerWebWrapper.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/platform/atoms/booker/BookerWebWrapper.tsx b/packages/platform/atoms/booker/BookerWebWrapper.tsx index ac3a272e24..e5948c2ff9 100644 --- a/packages/platform/atoms/booker/BookerWebWrapper.tsx +++ b/packages/platform/atoms/booker/BookerWebWrapper.tsx @@ -20,7 +20,7 @@ import { useVerifyEmail } from "@calcom/features/bookings/Booker/components/hook import { useBookerStore, useInitializeBookerStore } from "@calcom/features/bookings/Booker/store"; import { useEvent, useScheduleForEvent } from "@calcom/features/bookings/Booker/utils/event"; import { useBrandColors } from "@calcom/features/bookings/Booker/utils/use-brand-colors"; -import { DEFAULT_LIGHT_BRAND_COLOR, DEFAULT_DARK_BRAND_COLOR } from "@calcom/lib/constants"; +import { DEFAULT_LIGHT_BRAND_COLOR, DEFAULT_DARK_BRAND_COLOR, WEBAPP_URL } from "@calcom/lib/constants"; import { useRouterQuery } from "@calcom/lib/hooks/useRouterQuery"; import { BookerLayouts } from "@calcom/prisma/zod-utils"; @@ -188,11 +188,10 @@ export const BookerWebWrapper = (props: BookerWebWrapperAtomProps) => { router.push("/apps/categories/calendar"); }} onClickOverlayContinue={() => { - const currentUrl = new URL(window.location.href); - currentUrl.pathname = "/login/"; - currentUrl.searchParams.set("callbackUrl", window.location.pathname); - currentUrl.searchParams.set("overlayCalendar", "true"); - router.push(currentUrl.toString()); + const newUrl = new URL(`${WEBAPP_URL}/login`); + newUrl.searchParams.set("callbackUrl", window.location.pathname); + newUrl.searchParams.set("overlayCalendar", "true"); + router.push(newUrl.toString()); }} onOverlaySwitchStateChange={onOverlaySwitchStateChange} sessionUsername={session?.user.username}