react-with-firebase-auth
react-with-firebase-auth copied to clipboard
It seems that there is no token specified for user
Describe the bug I want to auth with Firebase and then use token - to store and retrieve data from firebase for authenticated users. It seems that user object does not contain token.
To Reproduce Steps to reproduce the behavior:
- Auth via Google or Email-password
- Check user object returned
- There is no token
Expected behavior Token property is shown there
There is a workaround - to useEffect() for user change. Then add property to the user with firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idToken) { // Send token to your backend via HTTPS // ... }).catch(function(error) { // Handle error });
Hey! In this example you can see the user data that is provided: https://armand1m.github.io/react-with-firebase-auth/
If you create an account it'll log in immediately and show you the tokens that come with the user data, which is just a stringified version of the user
property that is passed to the wrapped component
I assume you want to access the user.stsTokenManager.accessToken
let me know if this is what you're looking for; otherwise, we can try to provide tokens through the props.