fix: BookerEmbed breaking (#27143)

This commit is contained in:
Rajiv Sahal
2026-01-23 06:02:50 -03:00
committed by GitHub
parent 7ff54b4a27
commit b6b43c3318
2 changed files with 5 additions and 3 deletions
@@ -217,8 +217,10 @@ const BookerComponent = ({
);
// Cloudflare Turnstile Captcha
// Note: process.env may be undefined in embed contexts, so we safely check it
const isE2E = typeof process !== "undefined" && process.env?.NEXT_PUBLIC_IS_E2E;
const shouldRenderCaptcha = !!(
!process.env.NEXT_PUBLIC_IS_E2E &&
!isE2E &&
renderCaptcha &&
CLOUDFLARE_SITE_ID &&
CLOUDFLARE_USE_TURNSTILE_IN_BOOKER === "1" &&
@@ -3,9 +3,9 @@ import { getCookie } from "@calcom/lib/cookie";
/**
* NOTE: Feature can be easily rolled back by setting percentage to 0
*/
export const isVisitorWithinPercentage = ({ percentage }: { percentage: number }) => {
export const isVisitorWithinPercentage = ({ percentage }: { percentage: number }): boolean => {
// E2E tests must test all features regardless of their rollout percentage
if (process.env.NEXT_PUBLIC_IS_E2E) {
if (typeof process !== "undefined" && process.env?.NEXT_PUBLIC_IS_E2E) {
return true;
}