bug fixes
This commit is contained in:
@@ -17,7 +17,7 @@ import {
|
||||
signOut as firebaseSignOut
|
||||
} from 'firebase/auth'
|
||||
import { type FirebaseApp } from 'firebase/app'
|
||||
import { type User, type Auth } from '@firebase/auth'
|
||||
import { type User } from '@firebase/auth'
|
||||
import type { Firestore } from 'firebase/firestore'
|
||||
|
||||
// import { getAnalytics } from "firebase/analytics";
|
||||
@@ -39,13 +39,11 @@ const firebaseConfig = {
|
||||
|
||||
export let firebaseApp: FirebaseApp
|
||||
|
||||
export let firebaseAuth: Auth
|
||||
|
||||
export const user = ref<User | null>()
|
||||
|
||||
export const initialized = computed<boolean>(() => user.value !== undefined)
|
||||
|
||||
export const signOut = async () => firebaseSignOut(firebaseAuth)
|
||||
export const signOut = async () => firebaseSignOut(getAuth())
|
||||
|
||||
export const db = ref<Firestore>()
|
||||
|
||||
@@ -67,8 +65,8 @@ export const initializeFirebase = async () => {
|
||||
// // console.log(firebaseUser)
|
||||
// user.value = firebaseUser
|
||||
// })
|
||||
firebaseAuth = await getFirebaseAuth(firebaseApp)
|
||||
onAuthStateChanged(firebaseAuth, (firebaseUser) => {
|
||||
const auth = await getFirebaseAuth(firebaseApp)
|
||||
onAuthStateChanged(auth, (firebaseUser) => {
|
||||
user.value = firebaseUser
|
||||
})
|
||||
// firebase.auth().onAuthStateChanged((firebaseUser) => {
|
||||
|
||||
Reference in New Issue
Block a user