From 6873abcc4c2414f01b7bdff96465ce4dddde47da Mon Sep 17 00:00:00 2001 From: Matt DiMeglio Date: Mon, 25 Aug 2025 10:21:23 -0400 Subject: [PATCH] Update firebase.js --- contexts/firebase.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contexts/firebase.js b/contexts/firebase.js index bfd2449..fc8ff84 100644 --- a/contexts/firebase.js +++ b/contexts/firebase.js @@ -1,6 +1,8 @@ + import { initializeApp } from 'firebase/app'; -import { getAuth } from 'firebase/auth'; +import { initializeAuth, getReactNativePersistence } from 'firebase/auth'; +import AsyncStorage from '@react-native-async-storage/async-storage'; const firebaseConfig = { apiKey: process.env.EXPO_PUBLIC_FIREBASE_API_KEY, @@ -14,6 +16,8 @@ const firebaseConfig = { const app = initializeApp(firebaseConfig); -const auth = getAuth(app); +const auth = initializeAuth(app, { + persistence: getReactNativePersistence(AsyncStorage) +}); export { auth };