From c286d2fec38590c69b395443a57996fa474dc168 Mon Sep 17 00:00:00 2001 From: joel Date: Thu, 12 Sep 2024 22:00:17 +0300 Subject: [PATCH] fix: add to server side as well --- src/createServerClient.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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,