When I attempt to display the current user that is logged in
console.log(firebase.auth().currentUser.uid)
The user's UID is outputted.
I then decided to retrieve the current user's information from Firestore using the following code:
import firebase from 'firebase/app'
import "firebase/auth"
import db from '../firebase/firebaseInit'
async getCurrentUser(){
const database =
db.collection('users').doc(firebase.auth().currentUser.uid)
const dbResults = await database.get()
console.log(dbResults.data())
}
However, the result was undefined