diff --git a/src/createServerClient.ts b/src/createServerClient.ts index c4f3d6a..6aa7e2f 100644 --- a/src/createServerClient.ts +++ b/src/createServerClient.ts @@ -149,6 +149,7 @@ export function createServerClient< }, true, ); + const storageKey = options?.auth?.storageKey || options?.cookieOptions?.name; const client = createClient( supabaseUrl, @@ -163,9 +164,7 @@ export function createServerClient< }, }, auth: { - ...(options?.cookieOptions?.name - ? { storageKey: options.cookieOptions.name } - : null), + ...(storageKey ? { storageKey } : null), ...options?.auth, flowType: "pkce", autoRefreshToken: false,