How do I store a Firebase 9 onAuthStateChanged user object in a Vue ref? #6006
Unanswered
BenJackGill
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using Firebase 9 in my Vue 3 / Quasar / TypeScript app.
I am trying to fetch a user object from Firebase using the
onAuthStateChanged
method, storing it in a Vue ref, and then using that in my Piniauser
store.This is the
getUser.ts
composable I use to get the user from Firebase:And this is my Pinia store named
user.ts
:The
user.value
inside onAuthStateChanged correctly populates with the Firebase user object.But the
user.value
ref inside the Pinia store always returns null.What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions