armand1m / armand1m/react-with-firebase-auth

It seems that there is no token specified for user

Open
#102 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
130
Forks
31
PR merge metrics
No merged PRs in 30d

Description

**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:
1. Auth via Google or Email-password
2. Check user object returned
3. 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
});

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the user object exposed by the authentication higher-order component and compare it with the Firebase user returned after Google and email-password sign-in. Verify whether the token is expected to be part of that object or must be retrieved separately, then confirm the chosen behavior for both authentication flows.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, react, typescript
Domain
authentication, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.