nuxt-community / firebase-module

🔥 Easily integrate Firebase into your Nuxt project. 🔥
https://firebase.nuxtjs.org
MIT License
641 stars 99 forks source link

onAuthStateChangedMutation should include additional respnse data like additionalUserInfo #520

Open sugoidesune opened 3 years ago

sugoidesune commented 3 years ago

Is your feature request related to a problem? Please describe.

Twitter auth includes additionalUserInfo in the response from authentication.

var provider = new this.$fireModule.auth.TwitterAuthProvider()
this.$fire.auth.signInWithPopup(provider)
        .then((result) => {
        console.log(result.additionalUserInfo)
        }

This data is not available through the properties passed to the onAuthStateChangedMutation in the store, which are: authUser and claims

The one data point I was missing was the twitter handle found in result.additionalUserInfo.username

Describe the solution you'd like

pass additionalUserInfo to the onAuthStateChangedMutation

Describe alternatives you've considered

Expose the full response within the onAuthStateChangedMutation for flexibility with other providers if additionalUserInfo is not general across all social-authentications.

lupas commented 3 years ago

Sorry for the late response. Currently a bit busy, if anyone has time to look at this please feel free to create a PR.