From e17d55457fd798e85763100e137d04ca5ecaac06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20L=C3=B3pez?= Date: Mon, 30 Jun 2025 13:21:16 -0700 Subject: [PATCH] refactor: cookie domain logic in defaultCookies (#22168) --- packages/lib/default-cookies.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/lib/default-cookies.ts b/packages/lib/default-cookies.ts index bfd5a9b434..19d987b087 100644 --- a/packages/lib/default-cookies.ts +++ b/packages/lib/default-cookies.ts @@ -1,7 +1,5 @@ import type { CookieOption, CookiesOptions } from "next-auth"; -import { isENVDev } from "@calcom/lib/env"; - /** * Copy from 'https://github.com/nextauthjs/next-auth/blob/227ff2259f/src/core/lib/cookie.ts' as we can't import it directly * @@ -20,12 +18,7 @@ export function defaultCookies(useSecureCookies: boolean): CookiesOptions { const cookiePrefix = useSecureCookies ? "__Secure-" : ""; const defaultOptions: CookieOption["options"] = { - domain: isENVDev - ? process.env.ORGANIZATIONS_ENABLED - ? //FIXME: This is causing login to not work if someone uses anything other .cal.local for testing - ".cal.local" - : undefined - : NEXTAUTH_COOKIE_DOMAIN, + domain: NEXTAUTH_COOKIE_DOMAIN || undefined, // To enable cookies on widgets, // https://stackoverflow.com/questions/45094712/iframe-not-reading-cookies-in-chrome // But we need to set it as `lax` in development