You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
});
The text was updated successfully, but these errors were encountered:
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.
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:
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
});
The text was updated successfully, but these errors were encountered: