Making sure we let localhost still work

This commit is contained in:
Leo Giovanetti 2023-06-09 17:49:52 -03:00
parent 893b1f19a0
commit 33f79c6260
3 changed files with 17 additions and 4 deletions

View File

@ -5,6 +5,7 @@
# - SHARED
# - NEXTAUTH
# - E-MAIL SETTINGS
# - ORGANIZATIONS
# - LICENSE (DEPRECATED) ************************************************************************************
# https://github.com/calcom/cal.com/blob/main/LICENSE
@ -32,7 +33,9 @@ PRISMA_GENERATE_DATAPROXY=
# ***********************************************************************************************************
# - SHARED **************************************************************************************************
NEXT_PUBLIC_WEBAPP_URL='http://app.cal.local:3000'
# Set this to http://app.cal.local:3000 if you want to enable organizations, and
# check variable ORGANIZATIONS_ENABLED at the bottom of this file
NEXT_PUBLIC_WEBAPP_URL='http://localhost:3000'
# Change to 'http://localhost:3001' if running the website simultaneously
NEXT_PUBLIC_WEBSITE_URL='http://localhost:3000'
NEXT_PUBLIC_CONSOLE_URL='http://localhost:3004'
@ -184,7 +187,16 @@ EDGE_CONFIG=
NEXT_PUBLIC_MINUTES_TO_BOOK=5 # Minutes
# Vercel
# - ORGANIZATIONS *******************************************************************************************
# Enable Organizations non-prod domain setup, works in combination with organizations feature flag
# This is mainly needed locally, because for orgs to work a full domain name needs to point
# to the app, i.e. app.cal.local instead of using localhost, which is very disruptive
#
# This variable should only be set to 1 or true if you are in a non-prod environment and you want to
# use organizations
ORGANIZATIONS_ENABLED=
# Vercel Config to create subdomains for organizations
PROJECT_ID_VERCEL=
TEAM_ID_VERCEL=
AUTH_BEARER_TOKEN_VERCEL=

View File

@ -20,7 +20,7 @@ export function defaultCookies(useSecureCookies: boolean): CookiesOptions {
const cookiePrefix = useSecureCookies ? "__Secure-" : "";
const defaultOptions: CookieOption["options"] = {
domain: isENVDev ? "cal.local" : NEXTAUTH_COOKIE_DOMAIN,
domain: isENVDev ? (process.env.ORGANIZATIONS_ENABLED ? "cal.local" : undefined) : NEXTAUTH_COOKIE_DOMAIN,
// 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

View File

@ -279,6 +279,7 @@
"INTERCOM_SECRET",
"PROJECT_ID_VERCEL",
"TEAM_ID_VERCEL",
"AUTH_BEARER_TOKEN_VERCEL"
"AUTH_BEARER_TOKEN_VERCEL",
"ORGANIZATIONS_ENABLED"
]
}