diff --git a/src/supabase-clients/user/createSupabaseUserRouteHandlerClient.ts b/src/supabase-clients/user/createSupabaseUserRouteHandlerClient.ts index 9d47bff1..2a2d1dcc 100644 --- a/src/supabase-clients/user/createSupabaseUserRouteHandlerClient.ts +++ b/src/supabase-clients/user/createSupabaseUserRouteHandlerClient.ts @@ -9,14 +9,12 @@ type CookieOptions = createRouteHandlerClientParams['cookieOptions']; const isDevelopment = process.env.NODE_ENV === 'development'; -const optionalCookieOptions: CookieOptions = isDevelopment - ? undefined - : { - domain: '.digger.dev', - secure: false, - path: '/', - sameSite: 'lax', - }; +const optionalCookieOptions: CookieOptions = { + domain: isDevelopment ? undefined : '.digger.dev', + secure: !isDevelopment, + path: '/', + sameSite: 'lax', +}; // Outstanding bug //https://github.com/vercel/next.js/issues/45371 diff --git a/src/supabase-clients/user/createSupabaseUserServerActionClient.ts b/src/supabase-clients/user/createSupabaseUserServerActionClient.ts index b76ffb8f..53453278 100644 --- a/src/supabase-clients/user/createSupabaseUserServerActionClient.ts +++ b/src/supabase-clients/user/createSupabaseUserServerActionClient.ts @@ -9,14 +9,12 @@ type CookieOptions = createServerActionClientParams['cookieOptions']; const isDevelopment = process.env.NODE_ENV === 'development'; -const optionalCookieOptions: CookieOptions = isDevelopment - ? undefined - : { - domain: '.digger.dev', - secure: false, - path: '/', - sameSite: 'lax', - }; +const optionalCookieOptions: CookieOptions = { + domain: isDevelopment ? undefined : '.digger.dev', + secure: !isDevelopment, + path: '/', + sameSite: 'lax', +}; export const createSupabaseUserServerActionClient = () => createServerActionClient( diff --git a/src/supabase-clients/user/createSupabaseUserServerComponentClient.ts b/src/supabase-clients/user/createSupabaseUserServerComponentClient.ts index ec07b675..83df9eee 100644 --- a/src/supabase-clients/user/createSupabaseUserServerComponentClient.ts +++ b/src/supabase-clients/user/createSupabaseUserServerComponentClient.ts @@ -9,14 +9,12 @@ type createServerComponentClientParams = NonNullable< >; type CookieOptions = createServerComponentClientParams['cookieOptions']; -const optionalCookieOptions: CookieOptions = isDevelopment - ? undefined - : { - domain: '.digger.dev', - secure: false, - path: '/', - sameSite: 'lax', - }; +const optionalCookieOptions: CookieOptions = { + domain: isDevelopment ? undefined : '.digger.dev', + secure: !isDevelopment, + path: '/', + sameSite: 'lax', +}; export const createSupabaseUserServerComponentClient = () => createServerComponentClient( diff --git a/src/supabase-clients/user/supabaseUserClientComponentClient.ts b/src/supabase-clients/user/supabaseUserClientComponentClient.ts index 285578a3..64fd2b5a 100644 --- a/src/supabase-clients/user/supabaseUserClientComponentClient.ts +++ b/src/supabase-clients/user/supabaseUserClientComponentClient.ts @@ -9,14 +9,12 @@ type createClientComponentClientParams = NonNullable< >; type CookieOptions = createClientComponentClientParams['cookieOptions']; -const optionalCookieOptions: CookieOptions = isDevelopment - ? undefined - : { - domain: '.digger.dev', - secure: false, - path: '/', - sameSite: 'lax', - }; +const optionalCookieOptions: CookieOptions = { + domain: isDevelopment ? undefined : '.digger.dev', + secure: !isDevelopment, + path: '/', + sameSite: 'lax', +}; // apologies for the name, but it's the best I could come up with as // the util exported from @supabase/auth-helpers-nextjs is called