crud for tasks + auth
This commit is contained in:
@@ -1,7 +1,28 @@
|
||||
import { createClient } from '@supabase/supabase-js';
|
||||
import * as SecureStore from 'expo-secure-store';
|
||||
import 'react-native-url-polyfill/auto';
|
||||
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL!
|
||||
const supabaseKey = process.env.EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY!
|
||||
|
||||
export const supabase = createClient(
|
||||
process.env.EXPO_PUBLIC_SUPABASE_URL,
|
||||
process.env.EXPO_PUBLIC_SUPABASE_PUBLISHABLE_KEY
|
||||
)
|
||||
const SecureStoreAdapter = {
|
||||
getItem: async (key: string) => {
|
||||
return await SecureStore.getItemAsync(key);
|
||||
},
|
||||
setItem: async (key: string, value: string) => {
|
||||
await SecureStore.setItemAsync(key, value);
|
||||
},
|
||||
removeItem: async (key: string) => {
|
||||
await SecureStore.deleteItemAsync(key);
|
||||
},
|
||||
};
|
||||
|
||||
export const supabase = createClient(supabaseUrl, supabaseKey, {
|
||||
auth: {
|
||||
storage: SecureStoreAdapter,
|
||||
autoRefreshToken: true,
|
||||
persistSession: true,
|
||||
detectSessionInUrl: false,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user