Skip to content
Discussion options

You must be logged in to vote

Firebase.js


import { boot } from 'quasar/wrappers'
import { initializeApp } from 'firebase/app'
// import { getFirestore } from 'firebase/firestore'
import { getAuth, signOut } from 'firebase/auth'

// Your web app's Firebase configuration
const firebaseConfig = {
 ...
}

// Initialize Firebase
const app = initializeApp(firebaseConfig)
// const db = getFirestore(app)
const auth = getAuth(app)

const checkAuthStatus = () => {
  // console.log('running checkAuthStatus()')

  return new Promise((resolve, reject) => {
    try {
      auth
        .onAuthStateChanged(user => {
          console.log('userChecked:', user)
          resolve(user)
        })
    } catch {
      reject('api failed…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@RobbeVorsselmans
Comment options

Comment options

You must be logged in to vote
1 reply
@BenJackGill
Comment options

Answer selected by RobbeVorsselmans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants