-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
626238c
commit 7c7cf5c
Showing
8 changed files
with
270 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
import * as SecureStore from "expo-secure-store"; | ||
import { createClient } from "@supabase/supabase-js"; | ||
|
||
import "react-native-url-polyfill/auto"; | ||
import AsyncStorage from "@react-native-async-storage/async-storage"; | ||
import { createClient } from "@supabase/supabase-js"; | ||
|
||
const ExpoSecureStoreAdapter = { | ||
getItem: (key: string) => SecureStore.getItemAsync(key), | ||
setItem: (key: string, value: string) => SecureStore.setItemAsync(key, value), | ||
removeItem: (key: string) => SecureStore.deleteItemAsync(key), | ||
}; | ||
|
||
export const supabase = createClient( | ||
// App Throws if these are not defined, so we can safely cast | ||
const supabaseUrl = | ||
process.env.EXPO_PUBLIC_SUPABASE_URL ?? | ||
"https://nbyhwzvwvpwikgzoyank.supabase.co", | ||
"https://nbyhwzvwvpwikgzoyank.supabase.co"; | ||
|
||
const supabaseAnonKey = | ||
process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY ?? | ||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im5ieWh3enZ3dnB3aWtnem95YW5rIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDQwMDQyNTIsImV4cCI6MjAxOTU4MDI1Mn0.ytShtlo0sjKyGCeyqzdVXWpGe-9frCevLXAq1gdjG0w", | ||
{ | ||
auth: { | ||
storage: ExpoSecureStoreAdapter, | ||
autoRefreshToken: true, | ||
persistSession: true, | ||
// detectSessionInUrl: true, | ||
detectSessionInUrl: false, // set to false bc https://supabase.com/blog/react-native-authentication#OAuth | ||
// flowType: "pkce", // no. pita to implement | ||
}, | ||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im5ieWh3enZ3dnB3aWtnem95YW5rIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDQwMDQyNTIsImV4cCI6MjAxOTU4MDI1Mn0.ytShtlo0sjKyGCeyqzdVXWpGe-9frCevLXAq1gdjG0w"; | ||
|
||
export const supabase = createClient(supabaseUrl, supabaseAnonKey, { | ||
auth: { | ||
storage: AsyncStorage, | ||
autoRefreshToken: true, | ||
persistSession: true, | ||
detectSessionInUrl: false, | ||
}, | ||
); | ||
}); |
Oops, something went wrong.