From 6256d7a0fedcfb89fc7415d5f3e57c981d723663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20M=C3=B3ricz?= Date: Wed, 28 May 2025 17:06:14 +0200 Subject: [PATCH] separate index supa logic --- apps/api/src/services/index.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/apps/api/src/services/index.ts b/apps/api/src/services/index.ts index a5845d4b..9b01a5f1 100644 --- a/apps/api/src/services/index.ts +++ b/apps/api/src/services/index.ts @@ -12,18 +12,13 @@ class IndexSupabaseService { constructor() { const supabaseUrl = process.env.INDEX_SUPABASE_URL; const supabaseServiceToken = process.env.INDEX_SUPABASE_SERVICE_TOKEN; - const useDbAuthentication = process.env.USE_DB_AUTHENTICATION === "true"; // Only initialize the Supabase client if both URL and Service Token are provided. - if (!useDbAuthentication) { + if (!supabaseUrl || !supabaseServiceToken) { // Warn the user that Authentication is disabled by setting the client to null logger.warn( - "Authentication is disabled. Index supabase client will not be initialized.", + "Index supabase client will not be initialized.", ); this.client = null; - } else if (!supabaseUrl || !supabaseServiceToken) { - logger.error( - "Index supabase environment variables aren't configured correctly. Index supabase client will not be initialized. Fix ENV configuration or disable DB authentication with USE_DB_AUTHENTICATION env variable", - ); } else { this.client = createClient(supabaseUrl, supabaseServiceToken); }