Closed ottz0 closed 4 years ago
Ok....I got it...Might just recommend just to update and make the docs clearer as I got so confused with SSR and local mode as my universal is server side and client side and I thought nuxtServerInit would run the action
I'm using Universal mode and using the pre-rendered. If you want to use the this version set the auth to
auth: {
persistence: 'local',
initialize: {
onAuthStateChangedAction: 'firebaseStoreModule/actionInTheFirebaseStoreModule',
},
},
Hi @ottz0 Thanks for the input, glad it worked out in the end.
Yep, will make the docs clearer at some point. SSR is just experimental, we'll probably move that away to a seperate module anyway.
It's like the chicken or the egg....Where does authUser and claims come from and how do I initialise it?
I'm expecting it on my parameters but where does it come from and how do I access it? Is it coming back as a callback from firebase? from $firestore? from auth? from $fireAuth? So therefore it's undefined. my
res.locals.user
is emptyExample (I'm assigning a Const to authUser) so it exists....but where is it?
const { uid, email, emailVerified, displayName, photoURL } = authUser
Example Action
Example Mutation