From b3c2d3ff4ce3e393557eecec11ed735665c3df89 Mon Sep 17 00:00:00 2001 From: truskovskiyk Date: Fri, 20 Dec 2024 23:13:24 +0100 Subject: [PATCH] fix auth --- no-ocr-ui/src/lib/supabase.ts | 7 +++++++ no-ocr-ui/src/stores/authStore.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 no-ocr-ui/src/lib/supabase.ts diff --git a/no-ocr-ui/src/lib/supabase.ts b/no-ocr-ui/src/lib/supabase.ts new file mode 100644 index 0000000..44142de --- /dev/null +++ b/no-ocr-ui/src/lib/supabase.ts @@ -0,0 +1,7 @@ +import { createClient } from '@supabase/supabase-js'; + +// Provide default values for development to prevent initialization errors +const supabaseUrl = import.meta.env.VITE_SUPABASE_URL || 'http://localhost:54321'; +const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY || 'placeholder-key'; + +export const supabase = createClient(supabaseUrl, supabaseAnonKey); \ No newline at end of file diff --git a/no-ocr-ui/src/stores/authStore.ts b/no-ocr-ui/src/stores/authStore.ts index 06d7687..90ce9a3 100644 --- a/no-ocr-ui/src/stores/authStore.ts +++ b/no-ocr-ui/src/stores/authStore.ts @@ -1,6 +1,6 @@ import { create } from 'zustand'; import { AuthState } from '../types/auth'; -import { supabase } from '../config/supabase'; +import { supabase } from '../lib/supabase'; export const useAuthStore = create((set) => ({ user: null,