Skip to content

Commit e17d554

Browse files
authored
refactor: cookie domain logic in defaultCookies (calcom#22168)
1 parent d8d8bc4 commit e17d554

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

packages/lib/default-cookies.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import type { CookieOption, CookiesOptions } from "next-auth";
22

3-
import { isENVDev } from "@calcom/lib/env";
4-
53
/**
64
* Copy from 'https://github.com/nextauthjs/next-auth/blob/227ff2259f/src/core/lib/cookie.ts' as we can't import it directly
75
*
@@ -20,12 +18,7 @@ export function defaultCookies(useSecureCookies: boolean): CookiesOptions {
2018
const cookiePrefix = useSecureCookies ? "__Secure-" : "";
2119

2220
const defaultOptions: CookieOption["options"] = {
23-
domain: isENVDev
24-
? process.env.ORGANIZATIONS_ENABLED
25-
? //FIXME: This is causing login to not work if someone uses anything other .cal.local for testing
26-
".cal.local"
27-
: undefined
28-
: NEXTAUTH_COOKIE_DOMAIN,
21+
domain: NEXTAUTH_COOKIE_DOMAIN || undefined,
2922
// To enable cookies on widgets,
3023
// https://stackoverflow.com/questions/45094712/iframe-not-reading-cookies-in-chrome
3124
// But we need to set it as `lax` in development

0 commit comments

Comments
 (0)