From 0c7d2e1c3eb98062daf2c6384b0368b1ebb2d8c3 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 c59edb1..3e53e70 100644 --- a/src/createServerClient.ts +++ b/src/createServerClient.ts @@ -153,6 +153,7 @@ export function createServerClient< }, true, ); + const storageKey = options?.auth?.storageKey || options?.cookieOptions?.name; const client = createClient( supabaseUrl, @@ -167,9 +168,7 @@ export function createServerClient< }, }, auth: { - ...(options?.cookieOptions?.name - ? { storageKey: options.cookieOptions.name } - : null), + ...(storageKey ? { storageKey } : null), ...options?.auth, flowType: "pkce", autoRefreshToken: false,